diff options
| author | len-odoo <len@odoo.com> | 2018-11-29 13:10:12 +0000 |
|---|---|---|
| committer | len-odoo <len@odoo.com> | 2018-12-03 15:03:58 +0000 |
| commit | 24f7c7ce7f371bbc6c820f458de16e26a943723f (patch) | |
| tree | 217996622152eef3b1eefaaac634e45535e3f5fc /addons/web/static/src/js | |
| parent | 7b20604f2e39e5be6f0c8f9db9d852d38c1f7e55 (diff) | |
[FIX] web: add support for string and invisible attributes in pivot view
The pivot view may sum fields that are not really summable:
unsigned values (e.g. in the case of refunds)
values in different UOM, currencies (any different units really)
Which causes confusion when these fields are displayed.
We add support for the string and invisible attributes in the pivot view,
so that a field can be given a more informative name or hidden altogether.
opw 1909046
closes odoo/odoo#29144
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_view.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/pivot/pivot_view.js b/addons/web/static/src/js/views/pivot/pivot_view.js index 5c1562efb8c..d85076f8271 100644 --- a/addons/web/static/src/js/views/pivot/pivot_view.js +++ b/addons/web/static/src/js/views/pivot/pivot_view.js @@ -69,6 +69,14 @@ var PivotView = AbstractView.extend({ widgets[name] = field.attrs.widget; } + if (field.attrs.string) { + measures[name].string = field.attrs.string; + } + + if (field.attrs.invisible && py.eval(field.attrs.invisible)) { + delete measures[name]; + return; + } // add active measures to the measure list. This is very rarely // necessary, but it can be useful if one is working with a // functional field non stored, but in a model with an overrided |
