Browse Source

[FIX] partner_multi_relation: Fix errors on searches

* Fix error on search when leaf is (1, '=', 1)
* Another comparison fix with search arguments
pull/654/head
Pedro M. Baeza 7 years ago
parent
commit
91d8f4f423
  1. 2
      partner_multi_relation/__manifest__.py
  2. 6
      partner_multi_relation/models/res_partner.py

2
partner_multi_relation/__manifest__.py

@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
"name": "Partner relations", "name": "Partner relations",
"version": "10.0.1.0.0",
"version": "10.0.1.0.1",
"author": "Therp BV,Camptocamp,Odoo Community Association (OCA)", "author": "Therp BV,Camptocamp,Odoo Community Association (OCA)",
"complexity": "normal", "complexity": "normal",
"category": "Customer Relationship Management", "category": "Customer Relationship Management",

6
partner_multi_relation/models/res_partner.py

@ -143,7 +143,8 @@ class ResPartner(models.Model):
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
date_args = [] date_args = []
for arg in args: for arg in args:
if is_leaf(arg) and arg[0].startswith('search_relation'):
if (is_leaf(arg) and isinstance(arg[0], basestring) and
arg[0].startswith('search_relation')):
if arg[0] == 'search_relation_date': if arg[0] == 'search_relation_date':
date_args = [] date_args = []
break break
@ -155,7 +156,8 @@ class ResPartner(models.Model):
active_args = [] active_args = []
if self.env.context.get('active_test', True): if self.env.context.get('active_test', True):
for arg in args: for arg in args:
if is_leaf(arg) and arg[0].startswith('search_relation'):
if (is_leaf(arg) and isinstance(arg[0], basestring) and
arg[0].startswith('search_relation')):
active_args = [('relation_all_ids.active', '=', True)] active_args = [('relation_all_ids.active', '=', True)]
break break
return super(ResPartner, self).search( return super(ResPartner, self).search(

Loading…
Cancel
Save