Files
docuseal-tools/docuseal_signing/views/docuseal_template_views.xml
Quentin Mondot fddc2e5c4b
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m31s
tests / test (pull_request) Successful in 52s
[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>
2026-11-09 17:35:19 +01:00

90 lines
3.8 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="docuseal_template_view_list" model="ir.ui.view">
<field name="name">docuseal.template.list</field>
<field name="model">docuseal.template</field>
<field name="arch" type="xml">
<list string="Docuseal templates">
<field name="name"/>
<field name="template_id"/>
<field name="submitter_role_id"/>
<field name="server_action_id"/>
</list>
</field>
</record>
<record id="docuseal_template_view_form" model="ir.ui.view">
<field name="name">docuseal.template.form</field>
<field name="model">docuseal.template</field>
<field name="arch" type="xml">
<form string="Docuseal template">
<header>
<button
name="action_create_server_action"
string="Create contextual action"
type="object"
class="btn-primary"
invisible="server_action_id"
/>
<button
name="action_delete_server_action"
string="Delete contextual action"
type="object"
class="btn-danger"
invisible="not server_action_id"
confirm="Delete the contextual action? It will no longer appear in the Action menu on contacts."
/>
</header>
<sheet>
<group>
<field name="name"/>
<!-- Roles only exist once fetched from Docuseal: from
then on, another template needs a new entry. -->
<field name="role_ids" invisible="1"/>
<field name="template_id" readonly="role_ids"/>
<button
colspan="2"
name="action_fetch_fields"
string="Fetch from Docuseal"
type="object"
class="btn btn-secondary mb8"
invisible="not template_id"
/>
<field
name="submitter_role_id"
options="{'no_create': True, 'no_open': True}"
placeholder="Fetch from Docuseal to list the roles"
/>
</group>
<field name="field_ids" string="Field mapping">
<!-- Lines come from Docuseal only: no manual creation. -->
<list editable="bottom" create="0">
<field name="sequence" widget="handle"/>
<field
name="docuseal_field_name"
readonly="1"
force_save="1"
/>
<field
name="partner_field_id"
domain="[('model', '=', 'res.partner'), ('ttype', 'not in', ['one2many', 'many2many', 'binary'])]"
/>
</list>
</field>
<group>
<field name="server_action_id" readonly="1"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="docuseal_template_action" model="ir.actions.act_window">
<field name="name">Docuseal templates</field>
<field name="res_model">docuseal.template</field>
<field name="view_mode">list,form</field>
</record>
</odoo>