Skip to content
Snippets Groups Projects
Commit fed0b52d authored by Mathieu Duckerts-Antoine's avatar Mathieu Duckerts-Antoine
Browse files

[IMP] board: adapt board to comparison menu


The "board" module has been adapted accordingly to the recently
introduced comparison menu.

Task ID: 2245719

Co-authored-by: default avatarMathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: default avatarJulien Mougenot <jum@odoo.com>
parent be5a51a3
Branches
Tags
No related merge requests found
......@@ -56,9 +56,8 @@ odoo.define('board.AddToBoardMenu', function (require) {
orderedBy: searchQuery.orderedBy,
});
if (searchQuery.timeRanges && searchQuery.timeRanges.hasOwnProperty('fieldName')) {
const { fieldName: field, range, comparisonRange } = searchQuery.timeRanges;
context.add({
time_ranges : { field, range, comparisonRange },
comparison: searchQuery.timeRanges,
});
}
let controllerQueryParams;
......
......@@ -267,13 +267,8 @@ var BoardRenderer = FormRenderer.extend({
orderedBy: context.orderedBy || [],
};
if (['pivot', 'dashboard', 'graph', 'cohort'].includes(viewType)) {
if (context.time_ranges) {
const { field: fieldName, range, comparisonRange } = context.time_ranges;
searchQuery.timeRanges = { fieldName, range, comparisonRange };
} else {
searchQuery.timeRanges = {};
}
if (View.prototype.searchMenuTypes.includes('comparison')) {
searchQuery.timeRanges = context.comparison || {};
}
var view = new View(viewInfo, {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment