[FIX] orm,ir.model: add eval of domain for relationship fields

Without this, it has become impossible to add one2many fields
as custom fields, because the domain string is not evaluated

bzr revid: odo@openerp.com-20110329113824-5ca5bvp1awzies5u
This commit is contained in:
Olivier Dony 2011-03-29 13:38:24 +02:00
parent 9effe4fa6d
commit c39f1cca46
2 changed files with 3 additions and 3 deletions

View File

@ -303,10 +303,10 @@ class ir_model_fields(osv.osv):
# static table of properties
model_props = [ # (our-name, fields.prop, set_fn)
('field_description', 'string', lambda a: a),
('field_description', 'string', str),
('required', 'required', bool),
('readonly', 'readonly', bool),
('domain', '_domain', lambda a: a),
('domain', '_domain', eval),
('size', 'size', int),
('on_delete', 'ondelete', str),
('translate', 'translate', bool),

View File

@ -2818,7 +2818,7 @@ class orm(orm_template):
'string': field['field_description'],
'required': bool(field['required']),
'readonly': bool(field['readonly']),
'domain': field['domain'] or None,
'domain': eval(field['domain']) if field['domain'] else None,
'size': field['size'],
'ondelete': field['on_delete'],
'translate': (field['translate']),