diff options
| author | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-02-21 12:38:27 +0000 |
|---|---|---|
| committer | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-02-25 15:30:06 +0000 |
| commit | 743d55133166071e67e85f8dafe3076839f143d6 (patch) | |
| tree | 5b327dd3d0b3a9fb0d1288b1d6ab08a0c2399a5c /addons/web/static/src/js/views/graph/graph_model.js | |
| parent | c7851add36575ce3f34a692a53acfdf4432a4d0c (diff) | |
[FIX] web: Regroup and order date groupby options
A previous commit makes the graph view render only the finer interval
option for each date/datetime field.
The fact is that in the control panel, different options can be selected
in any order along with other groupbys. This can lead to situations like
'Foo > Date: Day > Bar > Date: Month'
and becomes unreadable.
For that reason we choose to regroup and order options. For the previous
situation, this leads to the following global groupby
'Foo > Date: Month > Date: Day > Bar'.
Our choice also make more sense in a list view for instance.
Task ID: 2198846
closes odoo/odoo#46269
X-original-commit: 59afc869233165e21ef94f485b91d33ac4543b24
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/graph/graph_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/graph/graph_model.js | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_model.js b/addons/web/static/src/js/views/graph/graph_model.js index b09d0a464d9..d8b8df2f1fd 100644 --- a/addons/web/static/src/js/views/graph/graph_model.js +++ b/addons/web/static/src/js/views/graph/graph_model.js @@ -2,14 +2,10 @@ odoo.define('web.GraphModel', function (require) { "use strict"; var core = require('web.core'); -const { DEFAULT_INTERVAL, INTERVAL_OPTIONS } = require('web.controlPanelViewParameters'); +const { DEFAULT_INTERVAL, rank } = require('web.controlPanelViewParameters'); var _t = core._t; -function rank(oId) { - return INTERVAL_OPTIONS.findIndex(o => o.optionId === oId); -} - /** * The graph model is responsible for fetching and processing data from the * server. It basically just do a(some) read_group(s) and format/normalize data. |
