From b63505f2a2b7eba0679631f61339804b08eaa929 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 2 Feb 2017 11:38:37 +0100 Subject: [PATCH] [FIX] partner_multi_relation: fix crash on partner with domain [(1, '=', 1)] As is_leaf test passes with that domain, startswith method cannot be applied to integers. Converting to string the arg, we avoid the problem. --- partner_multi_relation/models/res_partner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/partner_multi_relation/models/res_partner.py b/partner_multi_relation/models/res_partner.py index 3545a299c..2b4d35ffa 100644 --- a/partner_multi_relation/models/res_partner.py +++ b/partner_multi_relation/models/res_partner.py @@ -143,7 +143,7 @@ class ResPartner(models.Model): # pylint: disable=no-value-for-parameter date_args = [] for arg in args: - if is_leaf(arg) and arg[0].startswith('search_relation'): + if is_leaf(arg) and str(arg[0]).startswith('search_relation'): if arg[0] == 'search_relation_date': date_args = [] break @@ -155,7 +155,7 @@ class ResPartner(models.Model): active_args = [] if self.env.context.get('active_test', True): for arg in args: - if is_leaf(arg) and arg[0].startswith('search_relation'): + if is_leaf(arg) and str(arg[0]).startswith('search_relation'): active_args = [('relation_all_ids.active', '=', True)] break return super(ResPartner, self).search(