[FIX] fields property: do not create empty properties
fixes #595 In the case where a property for the company exists but has no related record (e.g. in case of type m2o with no defined value), not setting a value to this field for a new record would create a new property (as browse_null is not an instance of browse_record)
This commit is contained in:
parent
50871bb4fe
commit
4bfcbb2a48
|
@ -1428,7 +1428,8 @@ class property(function):
|
||||||
default_val = self._get_default(obj, cr, uid, prop_name, context)
|
default_val = self._get_default(obj, cr, uid, prop_name, context)
|
||||||
|
|
||||||
property_create = False
|
property_create = False
|
||||||
if isinstance(default_val, openerp.osv.orm.browse_record):
|
if isinstance(default_val, (openerp.osv.orm.browse_record,
|
||||||
|
openerp.osv.orm.browse_null)):
|
||||||
if default_val.id != id_val:
|
if default_val.id != id_val:
|
||||||
property_create = True
|
property_create = True
|
||||||
elif default_val != id_val:
|
elif default_val != id_val:
|
||||||
|
|
Loading…
Reference in New Issue