[FIX] delivery: shipping cost on delivery order

If the delivery method chosen is NOT an external provider (such as
Fedex, UPS...), the shipping cost is not set on the delivery order.

This fix will search for any shipping cost on the associated sale order
and will update the shipping cost accordingly on the delivery order.

opw-653328
This commit is contained in:
Nicolas Martinelli
2015-11-04 10:00:51 +01:00
parent ee43fcd176
commit f0ed54fc46
+2
View File
@@ -76,6 +76,8 @@ class StockPicking(models.Model):
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'))
return res