[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: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Julien Mougenot <jum@odoo.com>
This commit is contained in:
co-authored by
Julien Mougenot
parent
be5a51a345
commit
fed0b52dd5
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user