[FIX] allow to use the field 'id' in views (i.e., needed for domain)
bzr revid: christophe@tinyerp.com-20090423085750-rwt7kxgz7hmmop3f
This commit is contained in:
parent
9bcf97fa2d
commit
247c1972ab
|
@ -893,7 +893,10 @@ class orm_template(object):
|
||||||
arch = node.toxml(encoding="utf-8").replace('\t', '')
|
arch = node.toxml(encoding="utf-8").replace('\t', '')
|
||||||
fields = self.fields_get(cr, user, fields_def.keys(), context)
|
fields = self.fields_get(cr, user, fields_def.keys(), context)
|
||||||
for field in fields_def:
|
for field in fields_def:
|
||||||
if field in fields:
|
if field == 'id':
|
||||||
|
# sometime, the view may containt the (invisible) field 'id' needed for a domain (when 2 objects have cross references)
|
||||||
|
fields['id'] = {'readonly': True, 'type': 'integer', 'string': 'ID'}
|
||||||
|
elif field in fields:
|
||||||
fields[field].update(fields_def[field])
|
fields[field].update(fields_def[field])
|
||||||
else:
|
else:
|
||||||
cr.execute('select name, model from ir_ui_view where (id=%s or inherit_id=%s) and arch like %s', (view_id, view_id, '%%%s%%' % field))
|
cr.execute('select name, model from ir_ui_view where (id=%s or inherit_id=%s) and arch like %s', (view_id, view_id, '%%%s%%' % field))
|
||||||
|
|
Loading…
Reference in New Issue