Browse Source

Hide clear procedures

master
venkataakhil 1 year ago
parent
commit
e545a1d029
  1. 28
      smart_service/apis/support.py

28
smart_service/apis/support.py

@ -416,24 +416,24 @@ def set_procedure_false():
return False
@frappe.whitelist(allow_guest=1)
def clear_procedures():
try:
set_procedure_false()
frappe.db.sql('''delete FROM `tabPublish`;''')
frappe.db.sql('''delete FROM `tabPublish_Docs`;''')
frappe.db.sql('''update `tabVariant Mapping_Assets` set published=0;''')
frappe.db.sql('''update `tabSystem Mapping_Sub System` set procedure_is_published=0;''')
frappe.db.sql('''update `tabSystem Mapping_System Assets` set published=0;''')
frappe.db.commit()
except Exception as e:
return e
# @frappe.whitelist(allow_guest=1)
# def clear_procedures():
# try:
# set_procedure_false()
# frappe.db.sql('''delete FROM `tabPublish`;''')
# frappe.db.sql('''delete FROM `tabPublish_Docs`;''')
# frappe.db.sql('''update `tabVariant Mapping_Assets` set published=0;''')
# frappe.db.sql('''update `tabSystem Mapping_Sub System` set procedure_is_published=0;''')
# frappe.db.sql('''update `tabSystem Mapping_System Assets` set published=0;''')
# frappe.db.commit()
# except Exception as e:
# return e
@frappe.whitelist(allow_guest=1)
def circular_api():
api = frappe.db.sql(
'''SELECT name,title,status,description,circular_image as FileUrl,valid_till from `tabCircular` WHERE valid_till >='{}' '''.format(
'''SELECT creation,name,title,status,description,circular_image as FileUrl,valid_till from `tabCircular` WHERE valid_till >='{}' '''.format(
frappe.utils.today()), as_dict=True)
for i in api:
if i["status"] == "Active":

Loading…
Cancel
Save