Fixed: Batch date check was wrong and was causing and error.

This commit is contained in:
Tanshu 2013-10-04 17:05:58 +05:30
parent 5afe7ddd73
commit 68a41da5bf
1 changed files with 2 additions and 2 deletions

View File

@ -41,8 +41,8 @@ def issue_create_inventory(voucher, item, batch_consumed):
raise ValidationError("Quantity of {0} cannot be zero".format(item.product.name))
if batch_consumed == True and quantity > batch.quantity_remaining:
raise ValidationError("Quantity available is {0} only".format(batch.quantity_remaining))
if batch.name < voucher.date:
raise ValidationError("Batch of {0} was purchased after the issue date".format(item.product.name))
if batch.name > voucher.date:
raise ValidationError("Batch of {0} was purchased after the issue date".format(batch.product.name))
if batch_consumed is None:
pass
elif batch_consumed: