bzr revid: stephane@tinyerp.com-20080815140529-zm97py6zmbcq86ot
This commit is contained in:
Stephane Wirtel
2008-08-15 16:05:29 +02:00
2 changed files with 12 additions and 5 deletions
-1
View File
@@ -43,7 +43,6 @@ def _check_xml(self, cr, uid, ids, context={}):
logger = netsvc.Logger()
logger.notifyChannel('init', netsvc.LOG_ERROR, 'The view do not fit the required schema !')
logger.notifyChannel('init', netsvc.LOG_ERROR, relaxng.error_log.last_error)
print view.arch
return False
return True
+12 -4
View File
@@ -52,10 +52,18 @@ class expression(object):
""" transform the leafs of the expression """
def _rec_get(ids, table, parent):
if not ids:
return []
ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context)
return ids + _rec_get(ids2, table, parent)
if table._parent_store:
doms = []
for o in table.browse(cr, uid, ids, context=context):
if doms:
doms.insert(0,'|')
doms.append(['&',('parent_left','<',o.parent_right),('parent_left','>=',o.parent_left)])
return table.search(cr, uid, doms, context=context)
else:
if not ids:
return []
ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context)
return ids + _rec_get(ids2, table, parent)
if not self.__exp:
return self