From 1317543d72ed42ab079dbced6209388200532b13 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 4 Jun 2012 13:44:33 +0200 Subject: [PATCH] [IMP] Hide empty fields in form readonly bzr revid: fme@openerp.com-20120604114433-4dvm68xvdmln0ck6 --- addons/web/static/src/css/base.css | 3 +++ addons/web/static/src/css/base.sass | 3 +++ addons/web/static/src/js/view_form.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 6f4fcde3e95..3ee93c21b16 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1893,6 +1893,9 @@ .openerp .oe_form .oe_form_group_cell .oe_kanban_view { position: static; } +.openerp .oe_form .oe_form_readonly .oe_form_field:empty { + display: none; +} .openerp .oe_form .oe_form_button.oe_button { height: 22px; white-space: nowrap; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 4283a9633b3..1d1dabe3c6d 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1520,6 +1520,9 @@ $colour4: #8a89ba .oe_form_group_cell .oe_kanban_view // Hack due to absolute positioning of kanban view messing with o2m position: static + + .oe_form_readonly .oe_form_field:empty + display: none // }}} // FormView.buttons {{{ .oe_form diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 6bc708527af..be78ce8f006 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1004,7 +1004,7 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt this.process($new_sheet); }, process_form: function($form) { - if ($form.find('> sheet').length == 0) { + if ($form.find('> sheet').length === 0) { $form.addClass('oe_form_nosheet'); } var $new_form = this.render_element('FormRenderingForm', $form.getAttributes());