From 0cb7024e55e29c665785292cfe1a0843ed893963 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 8 May 2019 14:49:11 +0530 Subject: [PATCH] fix: job card issue, added validation in the stock entry --- erpnext/stock/doctype/stock_entry/stock_entry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index f8d91a7642..d106ed126f 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -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):