Send package weight in kilograms to Sendcloud

Since a3e3a447615f, the unit of total weight for a package can be configured.

Closes #13391
This commit is contained in:
Cédric Krier
2024-07-04 18:32:56 +02:00
parent e08a8ba208
commit 61c57bb841
@@ -145,6 +145,7 @@ class CreateShippingSendcloud(Wizard):
ModelData = pool.get('ir.model.data')
cm = UoM(ModelData.get_id('product', 'uom_centimeter'))
kg = UoM(ModelData.get_id('product', 'uom_kilogram'))
party = shipment.shipping_to
address = shipment.shipping_to_address
phone = address.contact_mechanism_get(
@@ -171,7 +172,8 @@ class CreateShippingSendcloud(Wizard):
'external_reference': '/'.join([shipment.number, package.number]),
'quantity': 1,
'order_number': shipment.number,
'weight': package.total_weight,
'weight': UoM.compute_qty(
package.weight_uom, package.total_weight, kg),
'length': UoM.compute_qty(package.length_uom, package.length, cm),
'width': UoM.compute_qty(package.width_uom, package.width, cm),
'height': UoM.compute_qty(package.height_uom, package.height, cm),