[FIX] delivery: add delivery cost on SO on transfer
The delivery cost was only added if the delivery type was not fixed or base_on_rule. This distinction has not place in the code.
This commit is contained in:
committed by
Richard Mathot
parent
a2b94b0b6d
commit
2394d267fe
@@ -73,9 +73,11 @@ class StockPicking(models.Model):
|
||||
self.ensure_one()
|
||||
res = super(StockPicking, self).do_transfer()
|
||||
|
||||
if self.carrier_id:
|
||||
self._add_delivery_cost_to_so()
|
||||
|
||||
if self.carrier_id and self.carrier_id.delivery_type not in ['fixed', 'base_on_rule'] and self.carrier_id.shipping_enabled:
|
||||
self.send_to_shipper()
|
||||
self._add_delivery_cost_to_so()
|
||||
elif self.carrier_id and self.carrier_id.delivery_type in ['fixed', 'base_on_rule'] and self.carrier_id.shipping_enabled:
|
||||
self.carrier_price = sum(self.sale_id.order_line.filtered(lambda r: r.is_delivery).mapped('price_unit'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user