git commit -a -m "[FIX] web: relational widgets
Traceback when save a record (e.g.: event.event) when edit and save a created one2many's record in form view (e.g.: event.question), if a one2many line are created previously inside the modal form view (e.g.: event.answer). Wrong check in _on_load_record to don't set starting_ids for created record
This commit is contained in:
@@ -525,7 +525,11 @@ var AbstractManyField = common.AbstractField.extend({
|
||||
},
|
||||
|
||||
_on_load_record: function (record) {
|
||||
this.starting_ids = record.id ? record[this.name].slice() : [];
|
||||
this.starting_ids = [];
|
||||
// don't set starting_ids for the new record
|
||||
if (record.id && (!isNaN(record.id) || record.id.indexOf(this.dataset.virtual_id_prefix) === -1)) {
|
||||
this.starting_ids = record[this.name].slice();
|
||||
}
|
||||
},
|
||||
|
||||
set_value: function(ids) {
|
||||
|
||||
Reference in New Issue
Block a user