fix in import error due to indentation issues in item_grou[
diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py
index a3ed364..b43523d 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 <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Please edit this list and import only required elements
import webnotes
@@ -34,33 +34,33 @@
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)