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>
86 lines
3.5 KiB
XML
86 lines
3.5 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"/>
|
|
<field name="template_id"/>
|
|
<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">
|
|
<list editable="bottom">
|
|
<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>
|