[IMP] partner_profiles: apply migration only on contact type partner
This commit is contained in:
@@ -262,7 +262,7 @@ class res_partner(models.Model):
|
|||||||
@api.model
|
@api.model
|
||||||
def _cron_generate_missing_public_profiles(self):
|
def _cron_generate_missing_public_profiles(self):
|
||||||
partners = self.search(
|
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:
|
for partner in partners:
|
||||||
partner.create_public_profile()
|
partner.create_public_profile()
|
||||||
@@ -277,7 +277,8 @@ class res_partner(models.Model):
|
|||||||
search_values = [
|
search_values = [
|
||||||
("is_company", "=", is_company),
|
("is_company", "=", is_company),
|
||||||
("active", "=", active),
|
("active", "=", active),
|
||||||
("partner_profile", "=", False)
|
("partner_profile", "=", False),
|
||||||
|
("type", "=", "contact")
|
||||||
]
|
]
|
||||||
if id:
|
if id:
|
||||||
search_values.append(("id", "=", id))
|
search_values.append(("id", "=", id))
|
||||||
@@ -328,6 +329,7 @@ class res_partner(models.Model):
|
|||||||
def _get_main_partner_search_values(self, partner):
|
def _get_main_partner_search_values(self, partner):
|
||||||
return [
|
return [
|
||||||
("active", "=", True),
|
("active", "=", True),
|
||||||
|
("type", "=", "contact"),
|
||||||
("is_main_profile", "=", True),
|
("is_main_profile", "=", True),
|
||||||
("is_company", "=", False),
|
("is_company", "=", False),
|
||||||
"|",
|
"|",
|
||||||
|
Reference in New Issue
Block a user