summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2020-07-02 10:43:25 +0000
committerMathieu Duckerts-Antoine <dam@odoo.com>2020-07-03 10:27:39 +0000
commit9aa3297b9d1928623db7a3c8073db767e28bbc58 (patch)
tree4035af13338cd450fadc74ad76a6988fedab218c /addons/web/static/src/js
parent833530248bdba112885ab387834149d7be9a34df (diff)
[FIX] web: reload search panel before view model
Problem: Go to the application apps, select accounting in the search panel, then filter on lunch in the search bar: the category all is displayed as selected in the search panel (accounting is no more a valid value since expand="0") but the application lunch does not appear in the kanban view. Root cause: The kanban model is reloaded with the old domain using accounting without waiting the search panel to be reloaded but it is only known after the search panel has been reloaded that the accounting value is no more valid and that all should be selected instead of accounting, thus that the domain used by the kanban model should be updated. Solution: The solution to the problem is simple: first reload the search panel, then reload the view model with the updated domain. X-original-commit: 8589babcd0f2c15433fe1eb06d0d745e80d01c22
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/abstract_controller.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js
index 07c4138c54d..8a48c201fa6 100644
--- a/addons/web/static/src/js/views/abstract_controller.js
+++ b/addons/web/static/src/js/views/abstract_controller.js
@@ -211,7 +211,6 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
* @returns {Promise}
*/
reload: async function (params = {}) {
- let searchPanelUpdateProm;
const controllerState = params.controllerState || {};
const cpState = controllerState.cpState;
if (this.withControlPanel && cpState) {
@@ -226,19 +225,19 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
}
if (controllerState.spState) {
this._searchPanel.importState(controllerState.spState);
- this.searchPanelDomain = this._searchPanel.getDomain();
} else {
const viewDomain = await this._getViewDomain();
- searchPanelUpdateProm = this._searchPanel.update({
+ await this._searchPanel.update({
searchDomain: this.controlPanelDomain,
viewDomain,
});
postponeRendering = !params.noRender;
params.noRender = true; // wait for searchpanel to be ready to render
}
+ this.searchPanelDomain = this._searchPanel.getDomain();
params.domain = this.controlPanelDomain.concat(this.searchPanelDomain);
}
- await Promise.all([this.update(params, {}), searchPanelUpdateProm]);
+ await this.update(params, {});
if (postponeRendering) {
return this._updateRendererState(false);
}