From 76199fd956c25e21c17865604ea5afd018b4df8a Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 10 Nov 2022 13:56:10 +0000 Subject: [PATCH] [FIX] delivery: Multi currencies with free shipping above amount Steps to reproduce the issue: - Let's consider two currencies C1, C2 - Let's consider two pricelists P1 in C1 and P2 in C2 - Let's consider that the current company CY has the default currency C1 - Let's consider that the current rate of C1 = 1.0 and C2 = 5.0 - Create a shipping method SM with fixed price = 50 and free shipping is above 100 (expressed in company currency) - Create a SO with P2 and add a line with a product of 200 C2 (equal to 40 C1) - Add shipping method SM Bug: The shipping was considered as free but the total of the SO was not above 100 in the currency of the company opw:3010266 closes odoo/odoo#107456 X-original-commit: c93ab6615f0370963b152cc0320478fe4ceed164 Signed-off-by: William Henrotin (whe) --- addons/delivery/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py index 9a32265844e..eb290a3b525 100644 --- a/addons/delivery/models/sale_order.py +++ b/addons/delivery/models/sale_order.py @@ -23,7 +23,7 @@ class SaleOrder(models.Model): def _compute_amount_total_without_delivery(self): self.ensure_one() delivery_cost = sum([l.price_total for l in self.order_line if l.is_delivery]) - return self.amount_total - delivery_cost + return self.env['delivery.carrier']._compute_currency(self, self.amount_total - delivery_cost, 'pricelist_to_company') @api.depends('order_line') def _compute_delivery_state(self):