Browse Source

[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.
pull/384/head
Pedro M. Baeza 8 years ago
parent
commit
b63505f2a2
  1. 4
      partner_multi_relation/models/res_partner.py

4
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(

Loading…
Cancel
Save