bzr revid: pinky-d6af6a25ec04d4deac5f726836325dead03002a7
This commit is contained in:
pinky 2007-03-20 12:19:23 +00:00
parent 5f2770ccfc
commit 8963c4e0d8
1 changed files with 11 additions and 7 deletions

View File

@ -1217,11 +1217,16 @@ class orm(object):
result['view_id'] = sql_res[3]
result['arch'] = sql_res[0]
# get all views which inherit from (ie modify) this view
cr.execute('select arch from ir_ui_view where inherit_id=%d and model=%s order by priority', (sql_res[3], self._name))
sql_inherit = cr.fetchall()
for (inherit,) in sql_inherit:
result['arch'] = _inherit_apply(result['arch'], inherit)
def _inherit_apply_rec(result, inherit_id):
# get all views which inherit from (ie modify) this view
cr.execute('select arch,id from ir_ui_view where inherit_id=%d and model=%s order by priority', (inherit_id, self._name))
sql_inherit = cr.fetchall()
for (inherit,id) in sql_inherit:
result = _inherit_apply(result, inherit)
result = _inherit_apply_rec(result,id)
return result
result['arch'] = _inherit_apply_rec(result['arch'], sql_res[3])
result['name'] = sql_res[1]
result['field_parent'] = sql_res[2] or False
@ -1343,12 +1348,12 @@ class orm(object):
if args[i][0]=='active':
if not args[i][2]:
del args[i]
break
i += 1
if i==len(args):
args.append(('active', '=', 1))
# if the object has a field named 'company_id', filter out all
# records which do not concern the current company (the company
# of the current user) or its "childs"
@ -1533,7 +1538,6 @@ class orm(object):
if res_trans:
res[lang][f]=res_trans
else:
print "columns:", self._columns[f].string
res[lang][f]=self._columns[f].string
for table in self._inherits:
cols = intersect(self._inherit_fields.keys(), fields)