[FIX] website_sale_delivery: avoid double conversion to currency on delivery provider

Yourcompany is in currency USD
Go to the website and select the CAD pricelist
Have Fedex installed (then you'll have to set weight on the product you buy)
*Expected with DHL and generally any API driven delivery*

Make an online order to the USA but in CAD

Before this commit:
At the "Choose your delivery method" step
You'll see that the amount for Fedex that seems to be 'converted twice' into CAD
(And it is)

This is because there is a slight mismatch in how delivery compute their price
When the delivery is fixed, or based on a rule
Its price is always in terms of its company's currency
Whereas
in other delivery type, the price is computed in terms of ther order's currency

See the difference between the implementation of the  methods:
<get_price_available>
and
<provider_get_shipping_price_from_so>

OPW 1813466
This commit is contained in:
Lucas Perais (lpe)
2018-02-28 09:14:10 +01:00
parent 4b1ed44936
commit d396ed515c
@@ -36,7 +36,7 @@
<span class="badge" t-field="delivery.price"
t-options='{
"widget": "monetary",
"from_currency": delivery.product_id.company_id.currency_id,
"from_currency": delivery.delivery_type in [&apos;fixed&apos;, &apos;base_on_rule&apos;] and delivery.product_id.company_id.currency_id or False,
"display_currency": website_sale_order.currency_id
}'/>
<div t-field="delivery.website_description" class="text-muted"/>