[FIX] delivery_fedex_hibou: multi-rating without a package

This commit is contained in:
Jared Kipe
2021-09-20 08:41:56 -07:00
parent 85162c8991
commit 0ca51cc44e

View File

@@ -558,6 +558,7 @@ class DeliveryFedex(models.Model):
) )
srm.set_master_package(weight_value, 1) srm.set_master_package(weight_value, 1)
else: else:
if picking.package_ids:
for sequence, package in enumerate(picking.package_ids, start=1): for sequence, package in enumerate(picking.package_ids, start=1):
package_weight = self._fedex_convert_weight(package.shipping_weight, self.fedex_weight_unit) package_weight = self._fedex_convert_weight(package.shipping_weight, self.fedex_weight_unit)
packaging = package.packaging_id packaging = package.packaging_id
@@ -575,6 +576,24 @@ class DeliveryFedex(models.Model):
reference=('%s-%d' % (order_name, sequence)), reference=('%s-%d' % (order_name, sequence)),
insurance=insurance_value insurance=insurance_value
) )
else:
# deliver all together...
package_weight = self._fedex_convert_weight(picking.shipping_weight or picking.weight, self.fedex_weight_unit)
packaging = self.fedex_default_packaging_id
srm.add_package(
package_weight,
mode='rating',
package_code=packaging.shipper_package_code,
package_height=packaging.height,
package_width=packaging.width,
package_length=packaging.packaging_length,
sequence_number=1,
# po_number=po_number,
# dept_number=dept_number,
reference=('%s-%d' % (order_name, 1)),
insurance=insurance_value
)
# Commodities for customs declaration (international shipping) # Commodities for customs declaration (international shipping)