From abbf44cab7958dd1c3c183ed2edfa87a930f699b Mon Sep 17 00:00:00 2001 From: Quentin Mondot Date: Sun, 1 Nov 2026 19:19:01 +0100 Subject: [PATCH] [FIX] docuseal_signing: send labels of relational and selection fields Pre-filled values were converted with str(), so a Many2one such as the partner title was sent as "res.partner.title(5,)" and a selection field as its technical key. Send the display name of relational fields and the label of selection fields instead. Assisted-By: Claude Opus 5.5 --- docuseal_signing/models/docuseal_template.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docuseal_signing/models/docuseal_template.py b/docuseal_signing/models/docuseal_template.py index f88b065..6903420 100644 --- a/docuseal_signing/models/docuseal_template.py +++ b/docuseal_signing/models/docuseal_template.py @@ -121,8 +121,15 @@ class DocusealTemplate(models.Model): value = partner[field_name] if hasattr(value, "strftime"): value = value.strftime("%d/%m/%Y") + elif isinstance(value, models.BaseModel): + value = ", ".join(value.mapped("display_name")) elif value is False or value is None: value = "" + elif partner._fields[field_name].type == "selection": + selection = partner._fields[field_name]._description_selection( + partner.env + ) + value = str(dict(selection).get(value, value)) else: value = str(value) # Lock pre-filled values so the signer cannot change them;