Browse Source

strip internal spaces in HTS number

The WPINT API requires a 10-digit HTS number without any spaces,
while the source number may contain spaces.  Our use of 'strip()' is
insufficient as it only removes leading and trailing spaces, but not
spaces inside the number.  We need to do replace(' ', '') instead.

Related: SYS#5415
master
Harald Welte 7 months ago
parent
commit
f85e288cf8
  1. 2
      models/dp_delivery_carrier.py

2
models/dp_delivery_carrier.py

@ -152,7 +152,7 @@ class DPDeliveryCarrier(models.Model):
else:
raise Warning('Product %s has no Country of Origin defined' % (ptempl.name))
weight = ptempl.weight
hts = ptmpl.customs_code.strip()
hts = ptmpl.customs_code.replace(' ', '')
desc = ptmpl.customs_description_en
if line.procurement_id and line.procurement_id.sale_line_id:
price_unit = line.procurement_id.sale_line_id.price_unit

Loading…
Cancel
Save