From ad3455c17f480ae34e1307aa35438eef416eba67 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 29 Jan 2015 17:22:46 +0100 Subject: [PATCH] [FIX] search both sides of the relation isolated to avoid false positives --- partner_relations/model/res_partner.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/partner_relations/model/res_partner.py b/partner_relations/model/res_partner.py index 288802f50..ff307b36e 100644 --- a/partner_relations/model/res_partner.py +++ b/partner_relations/model/res_partner.py @@ -106,11 +106,18 @@ class ResPartner(orm.Model): .search( cr, uid, [ - '|', ('type_id.name', arg[1], arg[2]), - ('type_id.name_inverse', arg[1], arg[2]), + ('record_type', '=', 'a'), ], context=context) + relation_type_selection_ids.extend( + relation_type_selection.search( + cr, uid, + [ + ('type_id.name_inverse', arg[1], arg[2]), + ('record_type', '=', 'b'), + ], + context=context)) if not relation_type_selection_ids: result = AND([result, [FALSE_LEAF]])