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
This commit is contained in:
Harald Welte 2021-04-18 10:46:26 +02:00
parent 3ebb9425d0
commit f85e288cf8
1 changed files with 1 additions and 1 deletions

View File

@ -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