Only 'available' moves in the picking when generating customs info

If we perform a partial shipment, we must only generate customs
information for those items which we are actually going to transfer.
This commit is contained in:
Harald Welte 2022-05-03 08:23:35 +02:00
parent fb5e942d45
commit b8decb3ec8
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ class SCDeliveryCarrier(models.Model):
return res
def build_sc_customs_decl(self, picking, explanation, currency='EUR'):
items = [self.build_sc_customs_item(x) for x in picking.move_lines]
items = [self.build_sc_customs_item(x) for x in picking.move_lines if picking.state == 'assigned']
total = 0.0
for i in items:
total += i['value_amount']