Files
docuseal-tools/docuseal_signing/models/docuseal_template_field.py
Quentin Mondot 77d556c14a [IMP] docuseal_signing: keep the Docuseal field order in the mapping
Fields are now ordered as returned by the Docuseal API: a sequence
field (reorderable with drag & drop) is written by
``action_fetch_fields`` according to the API field order, so deleting
a mapping line and re-fetching restores the original order instead of
appending it at the end.

Also refresh the French catalog (new Sequence field, new help texts,
stale smart_search entries dropped).

Covered by a unit test reproducing the delete-then-refetch scenario.

Assisted-By: GLM-5.3-Flash
2026-11-09 15:39:26 +01:00

26 lines
734 B
Python

from odoo import fields, models
class DocusealTemplateField(models.Model):
_name = "docuseal.template.field"
_description = "Docuseal Template Field"
_order = "sequence, id"
sequence = fields.Integer(default=10)
template_id = fields.Many2one(
comodel_name="docuseal.template",
string="Template",
required=True,
ondelete="cascade",
)
docuseal_field_name = fields.Char(string="Docuseal field", readonly=True)
partner_field_id = fields.Many2one(
comodel_name="ir.model.fields",
string="res.partner field",
domain=[
("model", "=", "res.partner"),
("ttype", "not in", ["one2many", "many2many", "binary"]),
],
)