Fix: Add product was borking as during check_inventories_are_valid the product_id of inventory was Null
This commit is contained in:
parent
2e3e451c35
commit
c8681b2994
@ -315,6 +315,7 @@ class Inventory(Base):
|
||||
self.product_id = product_id
|
||||
else:
|
||||
self.product = product
|
||||
self.product_id = product.id
|
||||
if batch is None:
|
||||
self.batch_id = batch_id
|
||||
else:
|
||||
|
@ -86,6 +86,7 @@ def read_file(input_file: UploadFile):
|
||||
else:
|
||||
encoding = "ascii"
|
||||
# raise ValidationError("The encoding of the attendance file is not correct")
|
||||
input_file.file.close()
|
||||
return StringIO(output.decode(encoding))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user