diff options
| author | Adrien Dieudonne <adr@odoo.com> | 2019-09-17 13:57:58 +0000 |
|---|---|---|
| committer | Adrien Dieudonne <adr@odoo.com> | 2019-09-18 09:09:13 +0000 |
| commit | 29bbdc9aa5ffba5f20c374b66b0045275c67f0c0 (patch) | |
| tree | d4b09190a93ec46b7c15a28a386d81301cd0c26a /addons/web/static/src/js/views/pivot/pivot_controller.js | |
| parent | 371daf1682239383a558a665e82ca943b3d42da1 (diff) | |
[IMP] web: PivotView: display grouped columns on mobile
Before this commit, only "Total" column was shown on mobile and
it wasn't possible to add another one.
(1) Now, we let the user to add it even if he probably will have to
scroll horizontally.
(2) The "Flip" button has been reintroduced like in desktop.
(3) By default, the old behavior will remain the same (only one
colum will be displayed) but to avoid frustrating for users
who always have to add manually columns to see the same information
as in desktop; you can use favorite filters.
In this case, all columns will be displayed.
Task ID : 1945893
opw-1935645
closes odoo/odoo#37057
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/pivot/pivot_controller.js')
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_controller.js | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/addons/web/static/src/js/views/pivot/pivot_controller.js b/addons/web/static/src/js/views/pivot/pivot_controller.js index 47eb5ad49fe..733a812d328 100644 --- a/addons/web/static/src/js/views/pivot/pivot_controller.js +++ b/addons/web/static/src/js/views/pivot/pivot_controller.js @@ -13,7 +13,6 @@ odoo.define('web.PivotController', function (require) { */ var AbstractController = require('web.AbstractController'); -var config = require('web.config'); var core = require('web.core'); var framework = require('web.framework'); var session = require('web.session'); @@ -115,16 +114,6 @@ var PivotController = AbstractController.extend({ this._updateButtons(); } }, - /** - * @override - * @param {Object} params - */ - update: function (params) { - if (config.device.isMobile && params.context) { - params.context.pivot_column_groupby = []; - } - return this._super.apply(this, arguments); - }, //-------------------------------------------------------------------------- // Private @@ -218,12 +207,7 @@ var PivotController = AbstractController.extend({ .toggleClass('selected', isSelected); }); var noDataDisplayed = !state.hasData || !state.measures.length; - var $flipButton = this.$buttons.find('.o_pivot_flip_button'); - if (config.device.isMobile) { - $flipButton.toggleClass('o_hidden', true); - } else { - $flipButton.prop('disabled', noDataDisplayed); - } + this.$buttons.find('.o_pivot_flip_button').prop('disabled', noDataDisplayed); this.$buttons.find('.o_pivot_expand_button').prop('disabled', noDataDisplayed); this.$buttons.find('.o_pivot_download').prop('disabled', noDataDisplayed); }, |
