From ca00968b631e2b8a1e20041dafc55f78283694e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Fri, 18 Sep 2026 14:16:41 +0200 Subject: [PATCH] [FIX] partner_profiles: remove writes to removed customer/supplier fields In Odoo 16 the ``customer`` and ``supplier`` boolean fields on ``res.partner`` were replaced by the ``customer_rank`` / ``supplier_rank`` integer counters, but the migration kept the block forcing them to ``False`` for public profiles. Any creation of a public profile therefore raised ``AttributeError: 'res.partner' object has no attribute 'customer'``, which also broke main profile creation through ``create_public_profile``. Remove the dead block instead of porting it to the new fields: ranks default to 0 and are only incremented on invoice posting through ``_increase_rank`` on the commercial partner, so a public profile never becomes a customer or supplier anyway. The original intent is preserved without redundant writes. --- partner_profiles/models/res_partner.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/partner_profiles/models/res_partner.py b/partner_profiles/models/res_partner.py index 281c922..d0ef228 100644 --- a/partner_profiles/models/res_partner.py +++ b/partner_profiles/models/res_partner.py @@ -127,10 +127,6 @@ class res_partner(models.Model): and not res.public_profile_id ): res.create_public_profile() - if res.partner_profile.ref == "partner_profile_public": #TODO: replace by check on boolean is_public_profile ? Is this boolean computed at this step of the process? - # Public profile can't be customer or supplier. Only main or position profiles can - res.customer = False - res.supplier = False else: res = super(res_partner, self).create(vals) return res