From cdcea7ec60d3536ea998a23055289567085a64fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Mon, 26 Jun 2023 15:01:16 +0200 Subject: [PATCH] [IMP] partner_profiles: apply migration only on contact type partner --- partner_profiles/models/res_partner.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/partner_profiles/models/res_partner.py b/partner_profiles/models/res_partner.py index 74149e2..c3cc0d1 100644 --- a/partner_profiles/models/res_partner.py +++ b/partner_profiles/models/res_partner.py @@ -262,7 +262,7 @@ class res_partner(models.Model): @api.model def _cron_generate_missing_public_profiles(self): partners = self.search( - [("is_main_profile", "=", True), ("public_profile_id", "=", False)] + [("is_main_profile", "=", True), ("public_profile_id", "=", False), ("type", "=", "contact")] ) for partner in partners: partner.create_public_profile() @@ -277,7 +277,8 @@ class res_partner(models.Model): search_values = [ ("is_company", "=", is_company), ("active", "=", active), - ("partner_profile", "=", False) + ("partner_profile", "=", False), + ("type", "=", "contact") ] if id: search_values.append(("id", "=", id)) @@ -328,6 +329,7 @@ class res_partner(models.Model): def _get_main_partner_search_values(self, partner): return [ ("active", "=", True), + ("type", "=", "contact"), ("is_main_profile", "=", True), ("is_company", "=", False), "|",