From d9b2eee0716612fde315a98a4673725ca5b20279 Mon Sep 17 00:00:00 2001 From: ced <> Date: Tue, 31 Jul 2007 14:08:39 +0000 Subject: [PATCH] kernel: remove test on active in child_of Use the context to pass if we must check for active or not. bzr revid: ced-bb3eaaa15cfd13159e3583280b44d4cb5f137799 --- bin/osv/orm.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index ff91bfd485a..ec5a2fcef4c 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1497,10 +1497,7 @@ class orm(object): def _rec_get(ids, table, parent): if not ids: return [] - if 'active' in table._columns: - ids2 = table.search(cr, user, [(parent,'in',ids),('active','in', [True, False])]) - else: - ids2 = table.search(cr, user, [(parent, 'in', ids)]) + ids2 = table.search(cr, user, [(parent, 'in', ids)], context=context) return ids + _rec_get(ids2, table, parent) def _rec_convert(ids): if self.pool.get(field._obj)==self: @@ -1530,10 +1527,7 @@ class orm(object): def _rec_get(ids, table, parent): if not ids: return [] - if 'active' in table._columns: - ids2 = table.search(cr, user, [(parent,'in',ids),('active','in', [True, False])]) - else: - ids2 = table.search(cr, user, [(parent, 'in', ids)]) + ids2 = table.search(cr, user, [(parent, 'in', ids)], context=context) return ids + _rec_get(ids2, table, parent) if field._obj <> table._name: args[i] = (args[i][0],'in',ids2+_rec_get(ids2, self.pool.get(field._obj), table._parent_name), table)