summaryrefslogtreecommitdiff
path: root/addons/web
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-12-05 16:38:13 +0100
committerXavier Morel <xmo@openerp.com>2011-12-05 16:38:13 +0100
commitb7aa4e4712e86a0acc23488ee5842e4c6a2a079b (patch)
treec53cb0653c120d4f4194be0463b842dd22827fbc /addons/web
parentd39e30130b8df4bc26f26fd9bf33d83fba0963be (diff)
[FIX] ensure o2m widget has saved its sub-views before it returns its value to its parent form view
This is currently highly faillible as saving a form or a list view can be an async operation, yet the FormView's `Widget#get_value` call can only be synchronous. As a result, there are cases where saving a form view can fail to get the correct value for its o2m fields. Ideally, `Widget#get_value` should be an async API (or a sync/async API) bzr revid: xmo@openerp.com-20111205153813-nvgy5413oyf5zsla
Diffstat (limited to 'addons/web')
-rw-r--r--addons/web/static/src/js/view_form.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index e24455917d9..a4355e1575b 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -2249,6 +2249,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
var self = this;
if (!this.dataset)
return [];
+ this.save_any_view();
var val = this.dataset.delete_all ? [commands.delete_all()] : [];
val = val.concat(_.map(this.dataset.ids, function(id) {
var alter_order = _.detect(self.dataset.to_create, function(x) {return x.id === id;});