[IMP] docuseal_signing: pick the submitter role from the Docuseal roles
Some checks failed
tests / test (pull_request) Successful in 56s
pre-commit / pre-commit (pull_request) Failing after 1m34s

The submitter role was a free text field. It is now a dropdown listing
only the submitter roles of the Docuseal template
(docuseal.template.role), fetched with the Docuseal UUID of each role.

- The "Fetch from Docuseal" button, now above the role, syncs the roles
  (matched by UUID then name, in the Docuseal order, the first one
  selected by default) and the fields of the selected role only,
  keeping the existing mappings.
- Changing the role fetches the fields of the new role from Docuseal
  with an empty mapping, and warns that saving loses the current one.
- Signature requests only send the fields of the submitter role.
- Docuseal API errors and a missing token raise a clear UserError.
- Keep the Docuseal field name of new mapping lines on save
  (force_save on the read-only column).

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 16:47:05 +01:00
parent f9a8358e95
commit c7f3a2dcfe
9 changed files with 419 additions and 70 deletions

View File

@@ -70,12 +70,14 @@ msgstr "Créer l'action contextuelle"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__create_uid
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__create_uid
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__create_uid
msgid "Created by"
msgstr "Créé par"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__create_date
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__create_date
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__create_date
msgid "Created on"
msgstr "Créé le"
@@ -103,6 +105,7 @@ msgstr ""
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__display_name
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__display_name
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__display_name
msgid "Display Name"
msgstr "Nom affiché"
@@ -150,8 +153,8 @@ msgstr "Templates Docuseal"
#. module: docuseal_signing
#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form
msgid "Fetch template fields"
msgstr "Rapatrier les champs du template"
msgid "Fetch from Docuseal"
msgstr "Rapatrier depuis Docuseal"
#. module: docuseal_signing
#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form
@@ -166,18 +169,21 @@ msgstr "Champs"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__id
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__id
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__id
msgid "ID"
msgstr "ID"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__write_uid
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__write_uid
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__write_date
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__write_date
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
@@ -191,13 +197,9 @@ msgstr "Gérer les templates Docuseal"
msgid "Name"
msgstr "Nom"
#. module: docuseal_signing
#: model:ir.model.fields,help:docuseal_signing.field_docuseal_template__submitter_role
msgid "Name of the submitter role you have set up in Docuseal."
msgstr "Nom du rôle de signataire défini dans Docuseal."
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__sequence
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__sequence
msgid "Sequence"
msgstr "Séquence"
@@ -209,17 +211,19 @@ msgstr "Action serveur"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__smart_search
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__smart_search
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__smart_search
#: model:ir.model.fields,field_description:docuseal_signing.field_res_config_settings__smart_search
msgid "Smart Search"
msgstr "Recherche intelligente"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__submitter_role
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__submitter_role_id
msgid "Submitter role"
msgstr "Rôle du signataire"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__template_id
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__template_id
msgid "Template"
msgstr "Template"
@@ -241,3 +245,81 @@ msgstr ""
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_field__partner_field_id
msgid "res.partner field"
msgstr "Champ res.partner"
#. module: docuseal_signing
#: model:ir.model,name:docuseal_signing.model_docuseal_template_role
msgid "Docuseal Template Submitter Role"
msgstr "Rôle de signataire du template Docuseal"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__uuid
msgid "Docuseal UUID"
msgstr "UUID Docuseal"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template_role__name
msgid "Role"
msgstr "Rôle"
#. module: docuseal_signing
#: model:ir.model.fields,field_description:docuseal_signing.field_docuseal_template__role_ids
msgid "Submitter roles"
msgstr "Rôles des signataires"
#. module: docuseal_signing
#: model_terms:ir.ui.view,arch_db:docuseal_signing.docuseal_template_view_form
msgid "Fetch from Docuseal to list the roles"
msgstr "Rapatrier depuis Docuseal pour lister les rôles"
#. module: docuseal_signing
#. odoo-python
#: code:addons/docuseal_signing/models/docuseal_template.py:0
msgid "Set the Docuseal API token in the General Settings first."
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"
#. module: docuseal_signing
#. odoo-python
#: code:addons/docuseal_signing/models/docuseal_template.py:0
msgid "Docuseal could not be reached at %(url)s: %(error)s"
msgstr "Docuseal est injoignable à l'adresse %(url)s : %(error)s"
#. module: docuseal_signing
#: model:ir.model.fields,help:docuseal_signing.field_docuseal_template__submitter_role_id
msgid ""
"Submitter role of the Docuseal template that the contact signs as. The "
"available roles are fetched from Docuseal."
msgstr ""
"Rôle du template Docuseal sous lequel le contact signe. Les rôles "
"disponibles sont rapatriés depuis Docuseal."
#. module: docuseal_signing
#: model:ir.model.fields,help:docuseal_signing.field_docuseal_template_role__uuid
msgid ""
"UUID of the submitter in the Docuseal template, used to find the template "
"fields of this role."
msgstr ""
"UUID du signataire dans le template Docuseal, utilisé pour retrouver les "
"champs du template propres à ce rôle."
#. module: docuseal_signing
#. odoo-python
#: code:addons/docuseal_signing/models/docuseal_template.py:0
msgid "Field mapping reset"
msgstr "Correspondance des champs réinitialisée"
#. module: docuseal_signing
#. odoo-python
#: code:addons/docuseal_signing/models/docuseal_template.py:0
msgid ""
"The fields of the new role are loaded with an empty mapping. If you save, "
"the current field mapping will be lost. Discard the changes to keep it."
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."