[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

@@ -1,3 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_docuseal_template_system,docuseal.template system,model_docuseal_template,base.group_system,1,1,1,1
access_docuseal_template_field_system,docuseal.template.field system,model_docuseal_template_field,base.group_system,1,1,1,1
access_docuseal_template_role_system,docuseal.template.role system,model_docuseal_template_role,base.group_system,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_docuseal_template_system docuseal.template system model_docuseal_template base.group_system 1 1 1 1
3 access_docuseal_template_field_system docuseal.template.field system model_docuseal_template_field base.group_system 1 1 1 1
4 access_docuseal_template_role_system docuseal.template.role system model_docuseal_template_role base.group_system 1 1 1 1