summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/graph/graph_model.js
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2020-05-25 18:11:02 +0000
committerMathieu Duckerts-Antoine <dam@odoo.com>2020-06-04 19:32:42 +0000
commitbe5a51a345b8986da0e19627260f64f984e11ae9 (patch)
tree4a0b1e5b0bfdad3124718ccf8e67164b5bbe07dd /addons/web/static/src/js/views/graph/graph_model.js
parent884ef9f7ee345ab1e940dbf88f4432b7e10f36e3 (diff)
[IMP] web: Comparison menu
This commit replaces the "time range menu" in the control panel by a new component: the "comparison menu". Its purpose is roughly the same: compare a period of data in a reporting view with the previous period or the previous year. Its implementation is a bit simpler: it will only appear if at least one date filter is selected in the search view, and will suggest to compare each selected date option with the previous period or the previous year. Task ID: 2245719 Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Julien Mougenot <jum@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.js11
1 files changed, 5 insertions, 6 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 6ee4d06651e..ccaa008f3f7 100644
--- a/addons/web/static/src/js/views/graph/graph_model.js
+++ b/addons/web/static/src/js/views/graph/graph_model.js
@@ -150,12 +150,11 @@ return AbstractModel.extend({
const { range, rangeDescription, comparisonRange, comparisonRangeDescription, fieldName } = this.chart.timeRanges;
if (range) {
- this.chart.domains = [this.chart.domain.concat(range)];
- this.chart.origins = [rangeDescription];
- if (comparisonRange) {
- this.chart.domains.push(this.chart.domain.concat(comparisonRange));
- this.chart.origins.push(comparisonRangeDescription);
- }
+ this.chart.domains = [
+ this.chart.domain.concat(range),
+ this.chart.domain.concat(comparisonRange),
+ ];
+ this.chart.origins = [rangeDescription, comparisonRangeDescription];
const groupBys = this.chart.processedGroupBy.map(function (gb) {
return gb.split(":")[0];
});