[FIX] delivery_hibou: multi-rating orders insurance

This commit is contained in:
Jared Kipe
2021-10-11 12:50:48 -07:00
parent 14f267e0bf
commit 4736fbc9f2

View File

@@ -20,7 +20,7 @@ class DeliveryCarrier(models.Model):
value = 0.0
if order:
if order.order_line:
value = sum(order.order_line.filtered(lambda l: l.type != 'service').mapped('price_subtotal'))
value = sum(order.order_line.filtered(lambda l: l.product_id.type != 'service').mapped('price_subtotal'))
else:
return value
if picking:
@@ -203,9 +203,9 @@ class DeliveryCarrier(models.Model):
res = []
for carrier in self:
carrier_packages = packages.filtered(lambda p: not p.carrier_tracking_ref and
(not p.carrier_id or p.carrier_id == carrier) and
p.packaging_id.package_carrier_type in (False, '', 'none', carrier.delivery_type))
carrier_packages = packages and packages.filtered(lambda p: not p.carrier_tracking_ref and
(not p.carrier_id or p.carrier_id == carrier) and
p.packaging_id.package_carrier_type in (False, '', 'none', carrier.delivery_type))
if packages and not carrier_packages:
continue
if hasattr(carrier, '%s_rate_shipment_multi' % self.delivery_type):