diff options
| author | Christophe Simonis <chs@odoo.com> | 2014-08-14 17:55:20 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2014-08-14 17:55:20 +0200 |
| commit | d68537022fc03baf59af29cb7cc8f9c5aa91a7b2 (patch) | |
| tree | f9d19987ffdc6801c31088bba46c1336bde8647a | |
| parent | 50ef63881abf2d2f66bffd1d0c02a504ccddac7d (diff) | |
[FIX] models: onchange on new records do not nullify fields from _inherits records
| -rw-r--r-- | openerp/models.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/openerp/models.py b/openerp/models.py index ae366aa647e..8daaa57a9e7 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -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': {}} |
