[fix] When we click a button in a m2o popup it closes the popup
authorniv-openerp <nicolas.vanhoren@openerp.com>
Thu, 13 Oct 2011 11:58:28 +0000 (13:58 +0200)
committerniv-openerp <nicolas.vanhoren@openerp.com>
Thu, 13 Oct 2011 11:58:28 +0000 (13:58 +0200)
lp bug: https://launchpad.net/bugs/873272 fixed

bzr revid: nicolas.vanhoren@openerp.com-20111013115828-ctbslk34qif4cfwt

addons/web/static/src/js/view_form.js

index 8bc31d4..fce00e7 100644 (file)
@@ -2483,7 +2483,6 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp
         this.setup_form_view();
     },
     on_write: function(id, data) {
-        this.stop();
         if (!this.options.auto_write)
             return;
         var self = this;
@@ -2506,7 +2505,9 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp
             $buttons.html(QWeb.render("FormOpenPopup.form.buttons"));
             var $nbutton = $buttons.find(".oe_formopenpopup-form-save");
             $nbutton.click(function() {
-                self.view_form.do_save();
+                self.view_form.do_save().then(function() {
+                    self.stop();
+                });
             });
             var $cbutton = $buttons.find(".oe_formopenpopup-form-close");
             $cbutton.click(function() {