diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 2988c0aa634..5ef56c69797 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1629,7 +1629,7 @@ font-weight: bold; color: #b33630; } -.openerp .oe_form_readonly header.oe_form_topbar_hifirst button:first-child, .openerp .oe_form_readonly button.oe_form_button_hi { +.openerp .oe_form_readonly button.oe_form_button_hi { color: white; background: #dc5f59; background: -moz-linear-gradient(#dc5f59, #b33630); @@ -1639,7 +1639,7 @@ -webkit-box-shadow: none; -box-shadow: none; } -.openerp .oe_form_readonly header.oe_form_topbar_hifirst button:first-child:hover, .openerp .oe_form_readonly button.oe_form_button_hi:hover { +.openerp .oe_form_readonly button.oe_form_button_hi:hover { background: #df6b66; background: -moz-linear-gradient(#df6b66, #bf3a33); background: -webkit-gradient(linear, left top, left bottom, from(#df6b66), to(#bf3a33)); @@ -1667,13 +1667,13 @@ -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); -box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); } +.openerp .oe_form_invisible { + display: none; +} .openerp .oe_form_editable .oe_form_editable_hidden { display: none; } -.openerp .oe_form_readonly .oe_form_readonly_hidden { - display: none; -} -.openerp .oe_form_readonly .oe_form_field:empty { +.openerp .oe_form_readonly .oe_form_readonly_hidden, .openerp .oe_form_readonly .oe_form_field:empty { display: none; } .openerp .oe_form .oe_form_field_text { @@ -1723,7 +1723,7 @@ } .openerp .oe_form .oe_form_field { width: 100%; - display: inline-block !important; + display: inline-block; padding: 2px 2px 2px 0px; line-height: 18px; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index df40fc8d151..c4d9d565b8b 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1287,7 +1287,7 @@ $colour4: #8a89ba font-weight: bold color: #b33630 .oe_form_readonly - header.oe_form_topbar_hifirst button:first-child, button.oe_form_button_hi + button.oe_form_button_hi color: white background: #DC5F59 background: -moz-linear-gradient(#DC5F59, #B33630) @@ -1296,7 +1296,7 @@ $colour4: #8a89ba -moz-box-shadow: none -webkit-box-shadow: none -box-shadow: none - header.oe_form_topbar_hifirst button:first-child:hover, button.oe_form_button_hi:hover + button.oe_form_button_hi:hover background: #DF6B66 background: -moz-linear-gradient( #DF6B66, #BF3A33) background: -webkit-gradient(linear, left top, left bottom, from( #DF6B66), to( #BF3A33)) @@ -1321,12 +1321,13 @@ $colour4: #8a89ba @include box-shadow(0 0 10px rgba(0,0,0,0.3)) // }}} // FormView.layout {{{ + .oe_form_invisible + display: none .oe_form_editable .oe_form_editable_hidden display: none - .oe_form_readonly .oe_form_readonly_hidden - display: none - .oe_form_readonly .oe_form_field:empty - display: none + .oe_form_readonly + .oe_form_readonly_hidden, .oe_form_field:empty + display: none .oe_form .oe_form_field_text width: 100% @@ -1376,8 +1377,7 @@ $colour4: #8a89ba resize: vertical .oe_form_field width: 100% - // Using !important because jQuery's $.fn.show() will set display to 'inline' for spans - display: inline-block !important + display: inline-block padding: 2px 2px 2px 0px line-height: 18px input diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a2d065e40b4..b8ea69d1c35 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1410,11 +1410,7 @@ instance.web.form.InvisibilityChangerMixin = { this._check_visibility(); }, _check_visibility: function() { - if (this.get("effective_invisible")) { - this.$element.hide(); - } else { - this.$element.show(); - } + this.$element.toggleClass('oe_form_invisible', this.get("effective_invisible")); }, };