diff --git a/partner_relations/model/res_partner_relation.py b/partner_relations/model/res_partner_relation.py
index 35bc71ddf..3ebb19b05 100644
--- a/partner_relations/model/res_partner_relation.py
+++ b/partner_relations/model/res_partner_relation.py
@@ -41,6 +41,13 @@ class ResPartnerRelation(models.Model):
_description = 'Partner relation'
_order = 'active desc, date_start desc, date_end desc'
+ def _search_any_partner_id(self, operator, value):
+ return [
+ '|',
+ ('left_partner_id', operator, value),
+ ('right_partner_id', operator, value),
+ ]
+
def _get_computed_fields(
self, cr, uid, ids, field_names, arg, context=None):
'''Return a dictionary of dictionaries, with for every partner for
@@ -101,6 +108,7 @@ class ResPartnerRelation(models.Model):
'res.partner',
string='Partner',
compute='_get_partner_type_any',
+ search='_search_any_partner_id'
)
left_partner_id = fields.Many2one(
diff --git a/partner_relations/view/res_partner_relation.xml b/partner_relations/view/res_partner_relation.xml
index 635107bb7..96bcb3982 100644
--- a/partner_relations/view/res_partner_relation.xml
+++ b/partner_relations/view/res_partner_relation.xml
@@ -46,7 +46,7 @@
res.partner.relation
-
+