From e475bc7a2aaf16e41e5dc0a148e3ddc5b389caf2 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 13 Jun 2012 17:34:12 +0200 Subject: [PATCH] [IMP] don;t needlessly wrap values into deferreds in pipes bzr revid: xmo@openerp.com-20120613153412-c2byqrc66jcn0e97 --- addons/web/static/src/js/view_form.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index e82a0f1818a..8d0fd141cdb 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -549,7 +549,8 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# return $.Deferred().reject(); } else { return $.when(this.reload()).pipe(function () { - return $.when(r).then(success); }, null); + return r; }) + .then(success); } }, /** @@ -583,8 +584,9 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.sidebar.attachments.do_update(); } //openerp.log("The record has been created with id #" + this.datarecord.id); - this.reload(); - return $.when(_.extend(r, {created: true})).then(success); + return $.when(this.reload()).pipe(function () { + return _.extend(r, {created: true}); }) + .then(success); } }, on_action: function (action) {