[IMP] bulk-update fields_view_get result via dict.update instead of a bunch of __setitem__
bzr revid: xmo@openerp.com-20110915111213-zigij077k9ss9p6e
This commit is contained in:
parent
7e8b8a3ce8
commit
8a9c0dbad7
|
@ -1954,14 +1954,13 @@ class orm_template(object):
|
||||||
|
|
||||||
# if a view was found
|
# if a view was found
|
||||||
if sql_res:
|
if sql_res:
|
||||||
result['type'] = sql_res['type']
|
|
||||||
result['view_id'] = sql_res['id']
|
|
||||||
|
|
||||||
source = etree.fromstring(encode(sql_res['arch']))
|
source = etree.fromstring(encode(sql_res['arch']))
|
||||||
result['arch'] = apply_view_inheritance(source, result['view_id'])
|
result.update(
|
||||||
|
arch=apply_view_inheritance(source, sql_res['id']),
|
||||||
result['name'] = sql_res['name']
|
type=sql_res['type'],
|
||||||
result['field_parent'] = sql_res['field_parent'] or False
|
view_id=sql_res['id'],
|
||||||
|
name=sql_res['name'],
|
||||||
|
field_parent=sql_res['field_parent'] or False)
|
||||||
else:
|
else:
|
||||||
|
|
||||||
# otherwise, build some kind of default view
|
# otherwise, build some kind of default view
|
||||||
|
@ -1994,10 +1993,11 @@ class orm_template(object):
|
||||||
else:
|
else:
|
||||||
# what happens here, graph case?
|
# what happens here, graph case?
|
||||||
raise except_orm(_('Invalid Architecture!'), _("There is no view of type '%s' defined for the structure!") % view_type)
|
raise except_orm(_('Invalid Architecture!'), _("There is no view of type '%s' defined for the structure!") % view_type)
|
||||||
result['arch'] = etree.fromstring(encode(xml))
|
result.update(
|
||||||
result['name'] = 'default'
|
arch=etree.fromstring(encode(xml)),
|
||||||
result['field_parent'] = False
|
name='default',
|
||||||
result['view_id'] = 0
|
field_parent=False,
|
||||||
|
view_id=0)
|
||||||
|
|
||||||
if parent_view_model != self._name:
|
if parent_view_model != self._name:
|
||||||
ctx = context.copy()
|
ctx = context.copy()
|
||||||
|
|
Loading…
Reference in New Issue