diff options
| author | Mohammed Shekha <msh@odoo.com> | 2020-01-16 13:48:20 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-01-27 09:01:19 +0000 |
| commit | 23878ee11ab121bb2d753e64c1d631ba2b85f6e0 (patch) | |
| tree | 9d60321392c1989a0c16204657951887918bf892 /addons/web/static/src/js/views/basic | |
| parent | ea9bbdbe30f3394d63301179f51c5ef9e962e91b (diff) | |
[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) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_renderer.js | 2 |
1 files changed, 1 insertions, 1 deletions
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, |
