From c2caa24bd6bc5a386e2a5463809860699c7736ca Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 10 Aug 2012 16:50:48 +0200 Subject: [PATCH] [FIX] small "or" in some x2x popup bzr revid: nicolas.vanhoren@openerp.com-20120810145048-ctnvl0w5r5h439f7 --- addons/web/static/src/js/view_form.js | 10 ++++------ addons/web/static/src/xml/base.xml | 24 +++++++++++++++++------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 0b1ed8fb67c..baf8c151b83 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -4165,7 +4165,10 @@ instance.web.form.AbstractFormPopup = instance.web.OldWidget.extend({ this.view_form.appendTo(this.$element.find(".oe_popup_form")); this.view_form.on_loaded.add_last(function() { var multi_select = self.row_id === null && ! self.options.disable_multiple_selection; - self.$buttonpane.html(QWeb.render("AbstractFormPopup.buttons", {multi_select: multi_select})); + self.$buttonpane.html(QWeb.render("AbstractFormPopup.buttons", { + multi_select: multi_select, + readonly: self.row_id !== null && self.options.readonly, + })); var $snbutton = self.$buttonpane.find(".oe_abstractformpopup-form-save-new"); $snbutton.click(function() { $.when(self.view_form.do_save()).then(function() { @@ -4186,11 +4189,6 @@ instance.web.form.AbstractFormPopup = instance.web.OldWidget.extend({ $cbutton.click(function() { self.check_exit(); }); - if (self.row_id !== null && self.options.readonly) { - $snbutton.hide(); - $sbutton.hide(); - $cbutton.text(_t("Close")); - } self.view_form.do_show(); }); }, diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 58f77840e69..c3ba8f79c8e 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1230,14 +1230,24 @@ Cancel - - + + + + + + + + + or - - - - - or Discard + + + Discard + + + Close + +