Skip to content
Browse files

[FIX] website_sale_delivery: don't replace error message by 'Free'

When a delivery carrier can't compute the delivery price, it returns an error
that is shown instead of the price (eg 'bpost Domestic is used only to ship
inside Belgium..').

But since 1ab53c2 everytime the user compute a carrier price and there is a
coupon allowing free delivery, every listed delivery carrier would have their
badges set to 'Free', including also carrier in error state.

This commit will not replace the error message by 'Free'.

Coming from odoo#31857
  • Loading branch information...
rdeodoo committed Mar 18, 2019
1 parent d1d7cc2 commit ec83faf50fbb4c2a734f870b7d40307485e7a15b
Showing with 5 additions and 2 deletions.
  1. +5 −2 addons/website_sale_delivery/static/src/js/website_sale_delivery.js
@@ -51,8 +51,9 @@ publicWidget.registry.websiteSaleDelivery = publicWidget.Widget.extend({
// Update discount of the order

// We are in freeshipping, so every carrier is Free
$('#delivery_carrier .badge').text(_t('Free'));
// We are in freeshipping, so every carrier is Free but we don't
// want to replace error message by 'Free'
$('#delivery_carrier .badge:not(.o_wsale_delivery_carrier_error)').text(_t('Free'));

if (result.status === true) {
@@ -63,10 +64,12 @@ publicWidget.registry.websiteSaleDelivery = publicWidget.Widget.extend({
$'disabled_reasons').carrier_selection = false;
$payButton.prop('disabled', _.contains($'disabled_reasons'), true));
} else {

0 comments on commit ec83faf

Please sign in to comment.
You can’t perform that action at this time.