diff --git a/partner_profiles/__manifest__.py b/partner_profiles/__manifest__.py index 955b947..16daa29 100644 --- a/partner_profiles/__manifest__.py +++ b/partner_profiles/__manifest__.py @@ -3,7 +3,7 @@ { "name": "partner_profiles", - "version": "12.0.1.0.2", + "version": "12.0.1.0.3", "author": "Elabore", "website": "https://elabore.coop", "maintainer": "Stéphan Sainléger", diff --git a/partner_profiles/models/res_partner.py b/partner_profiles/models/res_partner.py index 3af33fa..74d95a3 100644 --- a/partner_profiles/models/res_partner.py +++ b/partner_profiles/models/res_partner.py @@ -22,7 +22,7 @@ class res_partner(models.Model): is_position_profile = fields.Boolean( compute="_compute_profile_booleans", store=True ) - has_position = fields.Boolean(compute="_compute_profile_booleans", store=True) + has_position = fields.Boolean(compute="_compute_has_position", store=True) # If current partner is Main partner, this field indicates what its public profile is. public_profile_id = fields.Many2one( @@ -50,6 +50,10 @@ class res_partner(models.Model): partner.is_position_profile = ( partner.partner_profile.ref == "partner_profile_position" ) + + @api.depends("other_contact_ids") + def _compute_has_position(self): + for partner in self: partner.has_position = len(partner.other_contact_ids) > 0 @api.depends("partner_profile", "contact_id")