customs_declaration: use price from sale order, not move line

This commit is contained in:
Harald Welte 2021-02-15 10:59:22 +01:00
parent ef447dd8f9
commit 0abc037100
1 changed files with 5 additions and 1 deletions

View File

@ -126,12 +126,16 @@ class SCDeliveryCarrier(models.Model):
else:
raise Warning('Product %s has no Country of Origin defined' % (ptempl.name))
weight = ptempl.weight
if line.procurement_id and line.procurement_id.sale_line_id:
price_unit = line.procurement_id.sale_line_id.price_unit
else:
raise Warning('Line has no procurement or procurement no sale order line?!?')
res = {
'origin_country': orig,
'description': line.name,
'hs_tariff_number': hts,
'quantity': q,
'value_amount': line.price_unit,
'value_amount': price_unit,
'net_weight': weight,
}
return res