From 93de516123bec90be3a9190819da1ab51babc5cc Mon Sep 17 00:00:00 2001 From: SlWa99 Date: Wed, 7 Jan 2026 13:57:13 +0100 Subject: [PATCH 1/2] [T2855] FIX: Add passport field and naming logic in partner model --- child_protection/models/partner_compassion.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/child_protection/models/partner_compassion.py b/child_protection/models/partner_compassion.py index 572519b7c..adbf22a0d 100644 --- a/child_protection/models/partner_compassion.py +++ b/child_protection/models/partner_compassion.py @@ -38,6 +38,11 @@ class ResPartner(models.Model): compute="_compute_code_of_conduct_filename", ) + passport = fields.Binary( + attachment=True + ) + passport_name = fields.Char(compute="_compute_passport_name") + ########################################################################## # FIELDS METHODS # ########################################################################## @@ -55,6 +60,13 @@ def _compute_code_of_conduct_filename(self): else: record.code_of_conduct_filename = False + def _compute_passport_name(self): + for partner in self: + if partner.passport: + partner.passport_name = f"Passport_{partner.name}" + else: + partner.passport_name = False + ########################################################################## # ORM METHODS # ########################################################################## From 3c08f1ef6e922aee39d85eaf84eb75b6d344eede Mon Sep 17 00:00:00 2001 From: SlWa99 Date: Wed, 7 Jan 2026 14:00:34 +0100 Subject: [PATCH 2/2] [T2855] STYLE: Run pre-commit --- child_protection/models/partner_compassion.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/child_protection/models/partner_compassion.py b/child_protection/models/partner_compassion.py index adbf22a0d..45d80fae7 100644 --- a/child_protection/models/partner_compassion.py +++ b/child_protection/models/partner_compassion.py @@ -38,9 +38,7 @@ class ResPartner(models.Model): compute="_compute_code_of_conduct_filename", ) - passport = fields.Binary( - attachment=True - ) + passport = fields.Binary(attachment=True) passport_name = fields.Char(compute="_compute_passport_name") ##########################################################################