diff --git a/child_protection/models/partner_compassion.py b/child_protection/models/partner_compassion.py index 572519b7c..45d80fae7 100644 --- a/child_protection/models/partner_compassion.py +++ b/child_protection/models/partner_compassion.py @@ -38,6 +38,9 @@ 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 +58,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 # ##########################################################################