[fix] Uncheck 'Is Production Item' if it is a non-stock item
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index feb0213..739f934 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -87,6 +87,8 @@
is_stock_item: function(frm) {
erpnext.item.toggle_reqd(frm);
+ if(frm.doc.is_pro_applicable && !frm.doc.is_stock_item)
+ frm.set_value("is_pro_applicable", 0);
},
has_variants: function(frm) {
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index c02d9f1..1cbb33d 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -311,7 +311,7 @@
def validate_item_type(self):
if self.is_pro_applicable == 1 and self.is_stock_item==0:
- frappe.throw(_("As Production Order can be made for this item, it must be a stock item."))
+ self.is_pro_applicable = 0
if self.has_serial_no == 1 and self.is_stock_item == 0:
msgprint(_("'Has Serial No' can not be 'Yes' for non-stock item"), raise_exception=1)