From 68fb2c9b19b9ed6303f9c08fa761d5c7a40fa27d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 1 Mar 2012 18:20:31 +0530 Subject: [PATCH] fix in import error due to indentation issues in item_grou[ --- .../setup/doctype/item_group/item_group.py | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index a3ed364c7e..b43523d75a 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -8,11 +8,11 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # Please edit this list and import only required elements import webnotes @@ -34,33 +34,33 @@ convert_to_lists = webnotes.conn.convert_to_lists class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d,dl - self.nsm_parent_field = 'parent_item_group'; + def __init__(self,d,dl): + self.doc, self.doclist = d,dl + self.nsm_parent_field = 'parent_item_group'; - # update Node Set Model - def update_nsm_model(self): - import webnotes - import webnotes.utils.nestedset - webnotes.utils.nestedset.update_nsm(self) + # update Node Set Model + def update_nsm_model(self): + import webnotes + import webnotes.utils.nestedset + webnotes.utils.nestedset.update_nsm(self) - # ON UPDATE - #-------------------------------------- - def on_update(self): - # update nsm - self.update_nsm_model() + # ON UPDATE + #-------------------------------------- + def on_update(self): + # update nsm + self.update_nsm_model() - def validate(self): - if self.doc.lft and self.doc.rgt: - res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_item_group,self.doc.item_group_name)) - if not res: - msgprint("Please enter proper parent item group.") - raise Exception - - r = sql("select name from `tabItem Group` where name = '%s' and docstatus = 2"%(self.doc.item_group_name)) - if r: - msgprint("'%s' record is trashed. To untrash please go to Setup & click on Trash."%(self.doc.item_group_name)) - raise Exception + def validate(self): + if self.doc.lft and self.doc.rgt: + res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_item_group,self.doc.item_group_name)) + if not res: + msgprint("Please enter proper parent item group.") + raise Exception + + r = sql("select name from `tabItem Group` where name = '%s' and docstatus = 2"%(self.doc.item_group_name)) + if r: + msgprint("'%s' record is trashed. To untrash please go to Setup & click on Trash."%(self.doc.item_group_name)) + raise Exception def on_trash(self): ig = sql("select name from `tabItem` where ifnull(item_group, '') = %s", self.doc.name)