From 23878ee11ab121bb2d753e64c1d631ba2b85f6e0 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Thu, 16 Jan 2020 13:48:20 +0000 Subject: [IMP] web: always display statusbar widget By default, in readonly, unset field widgets (and their labels) are not displayed. However, we would like the statusbar widget to be always displayed (even when it is not set). This commit introduces a new method 'isEmpty' on AbstractField, and uses it (instead of isSet) to determine whether or not a field should be hidden. By default, it uses isSet, so that it doesn't change anything for the other fields, and we override it in statusbar to always return false. There was a need to make the distinction with isSet, as this one is used to determine if a record can be saved (if the field is required, and isSet returns false, it can't be). task-2172272 closes odoo/odoo#43419 Related: odoo/enterprise#7929 Signed-off-by: Aaron Bohy (aab) Co-authored-by: Aaron Bohy --- addons/web/static/src/js/views/basic/basic_renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js') diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js index 8af8540dd57..07edeae343a 100644 --- a/addons/web/static/src/js/views/basic/basic_renderer.js +++ b/addons/web/static/src/js/views/basic/basic_renderer.js @@ -662,7 +662,7 @@ var BasicRenderer = AbstractRenderer.extend({ element.$el.toggleClass('o_field_empty', !!( record.data.id && (modifiers.readonly || mode === 'readonly') && - !element.widget.isSet() + element.widget.isEmpty() )); }, keepBaseMode: !!options.keepBaseMode, -- cgit v1.2.3