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
This commit is contained in:
ced 2007-07-31 14:08:39 +00:00
parent 718d10d40d
commit d9b2eee071
1 changed files with 2 additions and 8 deletions

View File

@ -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)