Send package weight in kilograms to Sendcloud

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

Closes #13391
(grafted from 30926f185957e540abc8476d2cc8913175ef5deb)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2024-07-04 18:32:56 +02:00
1 parent 514fa0f6a2
commit c4065e8498
1 file changed
+3 -1
@@ -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),