Browse Source

[FIX] Fixing problems with migration of computed fields with search function and no computed function defined

14.0
mara1 4 years ago
committed by Raf Ven
parent
commit
96314522ff
  1. 8
      partner_multi_relation/models/res_partner.py
  2. 2
      partner_multi_relation/models/res_partner_relation_all.py

8
partner_multi_relation/models/res_partner.py

@ -29,24 +29,24 @@ class ResPartner(models.Model):
)
search_relation_type_id = fields.Many2one(
comodel_name="res.partner.relation.type.selection",
compute=lambda self: None,
compute=lambda self: self.update({"search_relation_type_id": None}),
search="_search_relation_type_id",
string="Has relation of type",
)
search_relation_partner_id = fields.Many2one(
comodel_name="res.partner",
compute=lambda self: None,
compute=lambda self: self.update({"search_relation_partner_id": None}),
search="_search_related_partner_id",
string="Has relation with",
)
search_relation_date = fields.Date(
compute=lambda self: None,
compute=lambda self: self.update({"search_relation_date": None}),
search="_search_relation_date",
string="Relation valid",
)
search_relation_partner_category_id = fields.Many2one(
comodel_name="res.partner.category",
compute=lambda self: None,
compute=lambda self: self.update({"search_relation_partner_category_id": None}),
search="_search_related_partner_category_id",
string="Has relation with a partner in category",
)

2
partner_multi_relation/models/res_partner_relation_all.py

@ -97,7 +97,7 @@ class ResPartnerRelationAll(models.Model):
any_partner_id = fields.Many2many(
comodel_name="res.partner",
string="Partner",
compute=lambda self: None,
compute=lambda self: self.update({"any_partner_id": None}),
search="_search_any_partner_id",
)

Loading…
Cancel
Save