summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2019-06-21 12:54:05 +0000
committerqdp-odoo <qdp@odoo.com>2019-06-28 11:53:19 +0000
commit3e3a244e1afc4d74920a6302a14fa2590e8b6648 (patch)
treed9a18837bd3d979183f57a1e6c20aaa88920ada1 /addons/web/static/src/js/views/basic
parentbeaa30a3d1843de43a45f419bfbc1bfa7613a920 (diff)
[FIX] web: BasicModel: don't update default one2many records
Let's assume a one2many field in a form view with a default value with commands 4 (link to). Before this rev., when saving the record, the BasicModel generated a command 4 and a command 1 (update) for each record, with the values of the record (directly coming from DB). This can cause an issue when the related record can't be edited (e.g. a posted journal entry in accounting). closes odoo/odoo#33797 Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js
index c87a6aca455..0cddc887f18 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -3175,7 +3175,7 @@ var BasicModel = AbstractModel.extend({
commands[fieldName].push(x2ManyCommands.link_to(list.res_ids[i]));
continue;
}
- changes = this._generateChanges(relRecord, options);
+ changes = this._generateChanges(relRecord, _.extend({}, options, {changesOnly: true}));
if (!this.isNew(relRecord.id)) {
// the subrecord already exists in db
commands[fieldName].push(x2ManyCommands.link_to(relRecord.res_id));