From dd01df261e0f78190136d5ffc77c57f1d09b1305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 23 Apr 2008 09:41:41 +0200 Subject: [PATCH] Fix where calc for clause on field inherits and remove unused child_of on id as it must use the many2one --- trytond/osv/orm.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index 595808bd1d..d25b4da765 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -2058,19 +2058,9 @@ class ORM(object): fargs = args[i][0].split('.', 1) field = table._columns.get(fargs[0], False) if not field: - # XXX must find a solution for long id list - if args[i][0] == 'id' and args[i][1] == 'child_of': - ids2 = args[i][2] - def _rec_get(ids, table, parent): - if not ids: - return [] - ids2 = table.search(cursor, user, - [(parent, 'in', ids)], context=context) - return ids2 + _rec_get(ids2, table, parent) - args[i] = (args[i][0], 'in', ids2 + \ - _rec_get(ids2, table, table._parent_name), table) - i += 1 - continue + if fargs[0] in self._inherit_fields: + table = self.pool.get(self._inherit_fields[args[i][0]][0]) + field = table._columns.get(fargs[0], False) if len(fargs) > 1: if field._type == 'many2one': args[i] = (fargs[0], 'inselect',