[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) <vfe@odoo.com>
This commit is contained in:
Andrea Geraldo
2023-10-13 11:46:12 +00:00
parent 13de773edd
commit 200b77b216
@@ -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