From 6e780b2e4f69cdee247afe4be964227a90b3d738 Mon Sep 17 00:00:00 2001 From: Julien Mougenot Date: Fri, 31 Jul 2020 11:47:53 +0000 Subject: [PATCH] [IMP] lunch: Make dispatch actions synchronous Before this commit, the return value of some of the dispatch actions of the lunch model extension was wrapped inside a promise with the use of the "async" keyword. This caused the synchronous aspect of all these methods to be delayed. Now they are not longer asynchronous. --- addons/lunch/static/src/js/lunch_model_extension.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/lunch/static/src/js/lunch_model_extension.js b/addons/lunch/static/src/js/lunch_model_extension.js index fccd82fdce9..aec64b9762a 100644 --- a/addons/lunch/static/src/js/lunch_model_extension.js +++ b/addons/lunch/static/src/js/lunch_model_extension.js @@ -55,9 +55,9 @@ odoo.define("lunch/static/src/js/lunch_model_extension.js", function (require) { * @param {number} locationId * @returns {Promise} */ - async setLocationId(locationId) { + setLocationId(locationId) { this.state.locationId = locationId; - await this.env.services.rpc({ + this.env.services.rpc({ route: "/lunch/user_location_set", params: { context: this.env.session.user_context, @@ -71,9 +71,9 @@ odoo.define("lunch/static/src/js/lunch_model_extension.js", function (require) { * @param {number} userId * @returns {Promise} */ - async updateUserId(userId) { + updateUserId(userId) { this.state.userId = userId; - await this._updateLocationId(); + this.shouldLoad = true; } //---------------------------------------------------------------------