[FIX] docuseal_signing: restrict signature requests and report API errors
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m31s
tests / test (pull_request) Successful in 50s

- Reserve the generated "Request signature" action to administrators
  (base.group_system), who are the only ones able to read the Docuseal
  templates, instead of letting other users hit an AccessError.
- Request the signature of a single contact from the contextual action
  (_action_request_signature): with several contacts, a failure could
  leave some of them already emailed while the action reports an error.
  A notification confirms the request.
- Share the Docuseal API call in _docuseal_request: a missing token or a
  Docuseal error (with the explanation it sends) now raises a readable
  UserError when sending submissions too, not only when fetching.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 17:03:54 +01:00
parent c7f3a2dcfe
commit 87653552b1
5 changed files with 210 additions and 43 deletions

View File

@@ -280,8 +280,8 @@ msgstr "Renseignez d'abord le token API Docuseal dans les Paramètres généraux
#. module: docuseal_signing
#. odoo-python
#: code:addons/docuseal_signing/models/docuseal_template.py:0
msgid "Docuseal returned an error for template %(template)s: %(code)s %(reason)s"
msgstr "Docuseal a renvoyé une erreur pour le template %(template)s : %(code)s %(reason)s"
msgid "Docuseal returned an error %(code)s: %(detail)s"
msgstr "Docuseal a renvoyé une erreur %(code)s : %(detail)s"
#. module: docuseal_signing
#. odoo-python
@@ -323,3 +323,21 @@ msgstr ""
"Les champs du nouveau rôle sont chargés sans correspondance. Si vous "
"enregistrez, la correspondance actuelle des champs sera perdue. Ignorez tous "
"les changements pour la conserver."
#. module: docuseal_signing
#. odoo-python
#: code:addons/docuseal_signing/models/docuseal_template.py:0
msgid "Select a single contact to request a signature."
msgstr "Sélectionnez un seul contact pour demander une signature."
#. module: docuseal_signing
#. odoo-python
#: code:addons/docuseal_signing/models/docuseal_template.py:0
msgid "Signature requested"
msgstr "Signature demandée"
#. module: docuseal_signing
#. odoo-python
#: code:addons/docuseal_signing/models/docuseal_template.py:0
msgid "The signature request has been sent to %(partner)s."
msgstr "La demande de signature a été envoyée à %(partner)s."