summaryrefslogtreecommitdiff
path: root/addons/delivery/models
diff options
context:
space:
mode:
authorJoseph Caburnay <jcb@odoo.com>2019-09-20 08:21:54 +0000
committerJoseph Caburnay <jcb@odoo.com>2019-09-20 08:32:44 +0000
commit5a9cb644147ee891e1afb3ddf88e052cdda7fb04 (patch)
treec8df1a95e309a1ac2ab0e8b90481c76f92ae5f2a /addons/delivery/models
parentf88520280a5a6c5d9ca60787e7dbdbbffda38eaf (diff)
[FIX] delivery: wrong delivery price for real cost policy
When real cost invoice policy is active in a delivery carrier, the delivery price is set after validating the delivery. When there is margin, the estimated price is calculated with margin but when the delivery is validated, the price set in the delivery line does not include the margin. This commit fixes this behavior by setting the price of the delivery line with appropriate margin. closes odoo/odoo#37178 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/delivery/models')
-rw-r--r--addons/delivery/models/stock_picking.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/delivery/models/stock_picking.py b/addons/delivery/models/stock_picking.py
index 9b46344a9b1..9b15974a938 100644
--- a/addons/delivery/models/stock_picking.py
+++ b/addons/delivery/models/stock_picking.py
@@ -153,7 +153,7 @@ class StockPicking(models.Model):
res = self.carrier_id.send_shipping(self)[0]
if self.carrier_id.free_over and self.sale_id and self.sale_id._compute_amount_total_without_delivery() >= self.carrier_id.amount:
res['exact_price'] = 0.0
- self.carrier_price = res['exact_price']
+ self.carrier_price = res['exact_price'] * (1.0 + (self.carrier_id.margin / 100.0))
if res['tracking_number']:
self.carrier_tracking_ref = res['tracking_number']
order_currency = self.sale_id.currency_id or self.company_id.currency_id