From a819f6f8abe32b82c02eb39414e4c23a00b0582e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 5 Aug 2011 11:09:25 +0530 Subject: [PATCH] rename function added in item --- stock/doctype/item/item.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stock/doctype/item/item.py b/stock/doctype/item/item.py index ae677493b5..7f0d3c2f69 100644 --- a/stock/doctype/item/item.py +++ b/stock/doctype/item/item.py @@ -178,3 +178,7 @@ Total Available Qty: %s sle = sql("select name from `tabStock Ledger Entry` where item_code = %s and ifnull(is_cancelled, 'No') = 'No'", self.doc.name) return sle and 'exists' or 'not exists' + + def on_rename(self,newdn,olddn): + sql("update tabItem set item_code = %s where name = %s", (newdn, olddn)) +