Merge pull request #17520 from rohitwaghchaure/added_validation_for_stock_entry_purpose_develop

fix: job card issue, added validation in the stock entry
This commit is contained in:
rohitwaghchaure 2019-05-08 16:16:52 +05:30 committed by GitHub
commit bb439f7662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,6 +129,10 @@ class StockEntry(StockController):
if self.purpose not in valid_purposes:
frappe.throw(_("Purpose must be one of {0}").format(comma_or(valid_purposes)))
if self.job_card and self.purpose != 'Material Transfer for Manufacture':
frappe.throw(_("For job card {0}, you can only make the 'Material Transfer for Manufacture' type stock entry")
.format(self.job_card))
def set_transfer_qty(self):
for item in self.get("items"):
if not flt(item.qty):