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