Fix: Add product was borking as during check_inventories_are_valid the product_id of inventory was Null

This commit is contained in:
Amritanshu Agrawal 2020-11-09 12:50:16 +05:30
parent 2e3e451c35
commit c8681b2994
2 changed files with 2 additions and 0 deletions

View File

@ -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:

View File

@ -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))