Fix bug on list call

This commit is contained in:
Bernat Brunet 2020-10-29 16:50:09 +01:00
parent 820c1bbc3c
commit 0cf34802b7
1 changed files with 1 additions and 1 deletions

View File

@ -247,7 +247,7 @@ class ShipmentIn(EdifactMixin, metaclass=PoolMeta):
('state', 'in', ('processing', 'done'))
])
if len(purchases) == 1:
purchase = purchase[0]
purchase = purchases[0]
if not purchase:
error_msg = 'Purchase number {} not found'.format(purchase_num)
serialized_segment = Serializer(control_chars).serialize([segment])