Do not check for batch on cancellation (#14506)

This commit is contained in:
Shreya Shah 2018-06-14 11:49:45 +05:30 committed by Nabin Hait
parent 8e74df09a4
commit dd8fba6783

View File

@ -77,8 +77,8 @@ class StockLedgerEntry(Document):
elif not frappe.db.get_value("Batch",{"item": self.item_code, "name": self.batch_no}):
frappe.throw(_("{0} is not a valid Batch Number for Item {1}").format(self.batch_no, self.item_code))
elif item_det.has_batch_no ==0 and self.batch_no:
frappe.throw(_("The Item {0} cannot have Batch").format(self.item_code))
elif item_det.has_batch_no ==0 and self.batch_no and self.is_cancelled == "No":
frappe.throw(_("The Item {0} cannot have Batch").format(self.item_code))
if item_det.has_variants:
frappe.throw(_("Stock cannot exist for Item {0} since has variants").format(self.item_code),