[FIX] models: onchange on new records do not nullify fields from _inherits records

This commit is contained in:
Christophe Simonis 2014-08-14 17:55:20 +02:00
parent 50ef63881a
commit d68537022f
1 changed files with 6 additions and 1 deletions

View File

@ -5628,7 +5628,12 @@ class BaseModel(object):
# dummy assignment: trigger invalidations on the record
for name in todo:
record[name] = record[name]
value = record[name]
field = self._fields[name]
if not field_name and field.type == 'many2one' and field.delegate and not value:
# do not nullify all fields of parent record for new records
continue
record[name] = value
result = {'value': {}}