diff --git a/addons/delivery/models/stock_picking.py b/addons/delivery/models/stock_picking.py index 9b15974a9381c9cc25c8d7d3ae32a810653d4799..be29fe890514ebee9c4d297ede8b2f4bf62ae9c8 100644 --- a/addons/delivery/models/stock_picking.py +++ b/addons/delivery/models/stock_picking.py @@ -170,12 +170,13 @@ class StockPicking(models.Model): sale_order = self.sale_id if sale_order and self.carrier_id.invoice_policy == 'real' and self.carrier_price: delivery_lines = sale_order.order_line.filtered(lambda l: l.is_delivery and l.currency_id.is_zero(l.price_unit) and l.product_id == self.carrier_id.product_id) + carrier_price = self.carrier_price * (1.0 + (float(self.carrier_id.margin) / 100.0)) if not delivery_lines: - sale_order._create_delivery_line(self.carrier_id, self.carrier_price) + sale_order._create_delivery_line(self.carrier_id, carrier_price) else: delivery_line = delivery_lines[0] delivery_line[0].write({ - 'price_unit': self.carrier_price, + 'price_unit': carrier_price, # remove the estimated price from the description 'name': sale_order.carrier_id.with_context(lang=self.partner_id.lang).name, })