From cdd5cfefd5ab38cd8d72c8a6c8255cb5e543a3fc Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 19 Sep 2012 12:17:41 +0530 Subject: [PATCH] make item code read-only after saving --- erpnext/stock/doctype/item/item.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 0a255d1291b..96c03399f16 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -18,6 +18,10 @@ cur_frm.cscript.refresh = function(doc) { // make sensitive fields(has_serial_no, is_stock_item, valuation_method) // read only if any stock ledger entry exists + if (!doc.__islocal) { + set_field_permlevel("item_code", 1); + } + if ((!doc.__islocal) && (doc.is_stock_item == 'Yes')) { var callback = function(r, rt) { if (r.message == 'exists') permlevel = 1;