From 33d43c5af100aaf9474231b370e0547f7ceb3015 Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Fri, 19 Jan 2018 18:15:40 +0530 Subject: [PATCH] [FIX] web: traceback when exporting from list view Former code of list controller used the searchView of its parent, which was the ViewManager. However, this has been changed by rev. 32b8cec53, where the ViewManager was removed, and the list controller now has the reference of the searchView, so this code had to be adapted. Tests have been adapted accordingly as well. --- addons/web/static/src/js/views/list/list_controller.js | 3 +-- addons/web/static/tests/widgets/data_export_tests.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/views/list/list_controller.js b/addons/web/static/src/js/views/list/list_controller.js index 33c1d234c7a..551fa8102be 100644 --- a/addons/web/static/src/js/views/list/list_controller.js +++ b/addons/web/static/src/js/views/list/list_controller.js @@ -64,8 +64,7 @@ var ListController = BasicController.extend({ // TODO: this method should be synchronous... var self = this; if (this.$('thead .o_list_record_selector input').prop('checked')) { - var searchView = this.getParent().searchview; // fixme - var searchData = searchView.build_search_data(); + var searchData = this.searchView.build_search_data(); var userContext = this.getSession().user_context; var results = pyeval.eval_domains_and_contexts({ domains: searchData.domains, diff --git a/addons/web/static/tests/widgets/data_export_tests.js b/addons/web/static/tests/widgets/data_export_tests.js index 192944ce3b5..4569a5a6290 100644 --- a/addons/web/static/tests/widgets/data_export_tests.js +++ b/addons/web/static/tests/widgets/data_export_tests.js @@ -94,7 +94,7 @@ QUnit.module('widgets', { }, }); - list.getParent().searchview = { + list.searchView = { build_search_data: function () { assert.step('build_search_data'); return { @@ -171,7 +171,7 @@ QUnit.module('widgets', { }, }); - list.getParent().searchview = { + list.searchView = { build_search_data: function () { assert.step('build_search_data'); return {