From 200b77b2165d61380a0f5fa34fdca67f1a6134da Mon Sep 17 00:00:00 2001 From: Andrea Geraldo Date: Tue, 3 Oct 2023 10:41:13 -0700 Subject: [PATCH] [IMP] website_sale: _onChangeCountry improvements Changed _onChangeCountry and _changeCountry from website_sale.js to make them inheritable by returning the value of the promise instead of returning nothing. closes odoo/odoo#137480 Signed-off-by: Victor Feyens (vfe) --- addons/website_sale/static/src/js/website_sale.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js index 9435e67f5dc..97c1b2673f4 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -238,7 +238,7 @@ export const WebsiteSale = publicWidget.Widget.extend(VariantMixin, cartHandlerM if (!$("#country_id").val()) { return; } - this.rpc("/shop/country_infos/" + $("#country_id").val(), { + return this.rpc("/shop/country_infos/" + $("#country_id").val(), { mode: $("#country_id").attr('mode'), }).then(function (data) { // placeholder phone_code @@ -628,7 +628,7 @@ export const WebsiteSale = publicWidget.Widget.extend(VariantMixin, cartHandlerM if (!this.$('.checkout_autoformat').length) { return; } - this._changeCountry(); + return this._changeCountry(); }, /** * @private