[FIX] docuseal_signing: harden template copies, API errors and emails
- Do not copy the contextual action nor the submitter role with a template: a copy sharing the action would rewrite or delete the original's. - Make the template ID read-only once fetched from Docuseal: another Docuseal template needs a new entry. - Report an invalid API URL or token, an unexpected (non-JSON) response and a connection dropped mid-response as a readable UserError. - Refuse to email a signature request to contacts without a valid email address (email_normalize), before any call to Docuseal. - Stop logging the field values and the Docuseal response, which hold personal data and the signing links. - Prevent adding mapping lines by hand: they come from Docuseal only. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -223,3 +223,15 @@ class TestFetchFields(DocusealApiMockMixin, TransactionCase):
|
||||
self.env["ir.config_parameter"].sudo().set_param("docuseal.api_token", "")
|
||||
with self.assertRaises(UserError):
|
||||
self.template.action_fetch_fields()
|
||||
|
||||
def test_template_id_is_readonly_once_fetched(self):
|
||||
"""The template ID can be set on a new entry, and becomes read-only
|
||||
once roles have been fetched from Docuseal."""
|
||||
form = Form(self.env["docuseal.template"])
|
||||
form.template_id = 1000
|
||||
new_template = form.save()
|
||||
|
||||
with Form(new_template) as form:
|
||||
self.assertFalse(form._get_modifier("template_id", "readonly"))
|
||||
with Form(self.template) as form:
|
||||
self.assertTrue(form._get_modifier("template_id", "readonly"))
|
||||
|
||||
Reference in New Issue
Block a user