diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index b61c599ba62..863b90a0f38 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2147,6 +2147,16 @@ .openerp .oe_form_readonly .oe_form .oe_form_field_date { width: auto; } +.openerp .oe_form_readonly .oe_form_field_boolean .boolean{ + position: relative; + top: -14px; + width: 14px; + height: 14px; + z-index:10000; + /* IE needs a color in order for the layer to respond to mouse events */ + backgroundColor: "#fff"; + opacity: 0; +} .openerp .oe_form_nosheet { margin: 16px; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 099b1c871f9..240dc912206 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1701,6 +1701,15 @@ $sheet-padding: 16px display: none !important .oe_form .oe_form_field_date width: auto + .oe_form_field_boolean.boolean + position: relative + top: -20px + width: 14px + height: 14px + z-index: 10000 + // IE needs a color in order for the layer to respond to mouse events + backgroundColor: "#fff" + opacity: 0 // Sheet and padding .oe_form_nosheet margin: 16px diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 454f20ddcd5..b07bd73854f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -203,7 +203,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.has_been_loaded.resolve(); // Add bounce effect on button 'Edit' when click on readonly page view. - this.$el.find(".oe_form_group_row,.oe_form_field,label").on('click', function (e) { + this.$el.find(".oe_form_group_row,.oe_form_field,label,h1,.oe_title,.oe_notebook_page, .oe_list_content").on('click', function (e) { if(self.get("actual_mode") == "view") { var $button = self.options.$buttons.find(".oe_form_button_edit"); $button.openerpBounce(); @@ -2743,6 +2743,7 @@ instance.web.form.FieldBoolean = instance.web.form.AbstractField.extend({ }, this)); var check_readonly = function() { self.$checkbox.prop('disabled', self.get("effective_readonly")); + self.click_disabled_boolean(); }; this.on("change:effective_readonly", this, check_readonly); check_readonly.call(this); @@ -2754,6 +2755,13 @@ instance.web.form.FieldBoolean = instance.web.form.AbstractField.extend({ focus: function() { var input = this.$checkbox && this.$checkbox[0]; return input ? input.focus() : false; + }, + click_disabled_boolean: function(){ + var $disabled = this.$el.find('input[type=checkbox]:disabled'); + $disabled.each(function (){ + $(this).next('div').remove(); + $(this).closest("span").append($('
')); + }); } }); @@ -5213,6 +5221,13 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({ url = this.placeholder; } var $img = $(QWeb.render("FieldBinaryImage-img", { widget: this, url: url })); + $($img).click(function(e) { + if(self.view.get("actual_mode") == "view") { + var $button = $(".oe_form_button_edit"); + $button.openerpBounce(); + e.stopPropagation(); + } + }); this.$el.find('> img').remove(); this.$el.prepend($img); $img.load(function() {