Browse Source

hide unused field myid

version2
venkata akhil 10 months ago
parent
commit
6138c77805
  1. 21
      smart_service/masters/doctype/role_master/role_master.py

21
smart_service/masters/doctype/role_master/role_master.py

@ -5,17 +5,18 @@ import frappe
from frappe.model.document import Document from frappe.model.document import Document
class RoleMaster(Document): class RoleMaster(Document):
def validate(self): pass
if self.is_new(): # def validate(self):
count = frappe.db.sql( # if self.is_new():
'''select max(my_id) as max_count from `tabRole Master`;''') # count = frappe.db.sql(
if count[0][0] is not None: # '''select max(my_id) as max_count from `tabRole Master`;''')
self.my_id = count[0][0] + 1 # if count[0][0] is not None:
else: # self.my_id = count[0][0] + 1
self.my_id = 1 # else:
# self.my_id = 1
if self.role: # if self.role:
self.role = self.role.strip() # self.role = self.role.strip()
@ frappe.whitelist() @ frappe.whitelist()
def get_module_names(): def get_module_names():

Loading…
Cancel
Save