[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) <whe@odoo.com>
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user