summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/control_panel/comparison_menu.js
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2020-07-13 13:23:36 +0000
committerMathieu Duckerts-Antoine <dam@odoo.com>2020-07-23 08:21:10 +0000
commitbb3bc7c9e4992dc07b10e87f87662bdd72f24d88 (patch)
tree073d814a44b00f13d7e8d5c9d939f169d54bbb08 /addons/web/static/src/js/control_panel/comparison_menu.js
parent3162141e4d71e9c55aff5241c5578571b68c332d (diff)
[IMP] *: adapt modules to Owl search panel
Adaptation of the rest of the environment to the changes regarding the refactored search panel and model. This commit includes the following changes: - Since the control panel model is now part of the search model, the view widget is responsible of its instantiation with the appropriate API; creating an ActionModel holding the required model extensions. - The controller is now importing/exporting the state of the entire search model as well as the current state of the search panel (given throught its props). Changes have been made to adapt to this behaviour. - The multiple components linked to the control panel model have been adapted to reflect the changes brought to it (they will now listen to the "searchModel" instead of the "controlPanelModel"). - The `test_utils_create` methods have also been adapted to properly instantiate a searchModel Part of task 2228968 Co-authored-by: Julien Mougenot <jum@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/control_panel/comparison_menu.js')
-rw-r--r--addons/web/static/src/js/control_panel/comparison_menu.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web/static/src/js/control_panel/comparison_menu.js b/addons/web/static/src/js/control_panel/comparison_menu.js
index 4504370e7c4..dee1c982d2e 100644
--- a/addons/web/static/src/js/control_panel/comparison_menu.js
+++ b/addons/web/static/src/js/control_panel/comparison_menu.js
@@ -3,7 +3,7 @@ odoo.define("web.ComparisonMenu", function (require) {
const DropdownMenu = require("web.DropdownMenu");
const { FACET_ICONS } = require("web.searchUtils");
- const { useModel } = require("web.model");
+ const { useModel } = require("web/static/src/js/model.js");
/**
* "Comparison" menu
@@ -15,7 +15,7 @@ odoo.define("web.ComparisonMenu", function (require) {
class ComparisonMenu extends DropdownMenu {
constructor() {
super(...arguments);
- this.model = useModel("controlPanelModel");
+ this.model = useModel('searchModel');
}
//---------------------------------------------------------------------
@@ -33,7 +33,7 @@ odoo.define("web.ComparisonMenu", function (require) {
* @override
*/
get items() {
- return this.model.getFiltersOfType("comparison");
+ return this.model.get('filters', f => f.type === 'comparison');
}
/**