From 375cde4422f6572d5fe83c3837f6a77c484486b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 15 Jun 2015 01:09:18 +0200 Subject: [PATCH] Remove unecessary join in Many2Many getter The target Many2One can be directly used now. issue4799 review15471002 --- trytond/model/fields/many2many.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/model/fields/many2many.py b/trytond/model/fields/many2many.py index 7816f26849..b1933ad517 100644 --- a/trytond/model/fields/many2many.py +++ b/trytond/model/fields/many2many.py @@ -90,7 +90,7 @@ class Many2Many(Field): clause = [(self.origin, 'in', references)] else: clause = [(self.origin, 'in', list(sub_ids))] - clause += [(self.target + '.id', '!=', None)] + clause += [(self.target, '!=', None)] relations.append(Relation.search(clause, order=order)) relations = list(chain(*relations))