From a50899cb565341d90bd31e56cd4d014f21daaf04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 Apr 2009 00:37:05 +0200 Subject: [PATCH] Use read instead of browse in Many2Many for performence --- trytond/model/fields/many2many.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trytond/model/fields/many2many.py b/trytond/model/fields/many2many.py index 7585b72213..25d2d09dc7 100644 --- a/trytond/model/fields/many2many.py +++ b/trytond/model/fields/many2many.py @@ -67,9 +67,9 @@ class Many2Many(Field): (self.target + '.id', '!=', False), ], order=self.order, context=context) - for relation in relation_obj.browse(cursor, user, relation_ids, - context=context): - res[relation[self.origin].id].append(relation[self.target].id) + for relation in relation_obj.read(cursor, user, relation_ids, + [self.origin, self.target], context=context): + res[relation[self.origin]].append(relation[self.target]) return res def set(self, cursor, user, record_id, model, name, values, context=None):