fix in import error due to indentation issues in item_grou[
This commit is contained in:
parent
232d725fd7
commit
68fb2c9b19
@ -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 @@ 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user