From 07ce3cd4d1bb300972ab02e3613819890bc0b630 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 16 Oct 2015 15:47:58 +0200 Subject: [PATCH] [FIX] web: error on change value in o2m after an other field onchange if the o2m contains o2m o2m editable list open a form view and can put command as default value (record[this.name] for o2m in a o2m) for the editable fields. When the onchange is triggered, get_value create a wrong command of command. step to reproduce issue: * edit a quotation with at least on sale order line * change the pricelist * change the quantity of the sale order line todo : remove _on_load_record in version > 9.0 and use new dataset implementation with to_delete attribute --- addons/web/static/src/js/views/form_relational_widgets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js index 1f1e7351005..0ff95ca9448 100644 --- a/addons/web/static/src/js/views/form_relational_widgets.js +++ b/addons/web/static/src/js/views/form_relational_widgets.js @@ -466,7 +466,7 @@ var AbstractManyField = common.AbstractField.extend({ this.starting_ids = []; // don't set starting_ids for the new record if (record.id && record[this.name] && (!isNaN(record.id) || record.id.indexOf(this.dataset.virtual_id_prefix) === -1)) { - this.starting_ids = record[this.name].slice(); + this.starting_ids = this.get('value').slice(); } this.trigger("load_record", record); },