Do not set rec_name for unsaved record
Since 0db956eb2505 _changed_value is used for on_change_with calls, so it can have to deal with unsaved Many2One value if it is the parent of a One2Many. (grafted from 206e247e16437dc8b2f1989cc13b7e48a1d0dfc7) --HG-- branch : 6.0
This commit is contained in:
@@ -858,7 +858,8 @@ class ModelView(Model):
|
||||
continue
|
||||
if field._type in ('many2one', 'one2one', 'reference'):
|
||||
if value:
|
||||
if isinstance(value, ModelStorage):
|
||||
if (isinstance(value, ModelStorage)
|
||||
and value.id and value.id >= 0):
|
||||
changed['%s.' % fname] = {
|
||||
'rec_name': value.rec_name,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user