diff --git a/smart_service/apis/master_api.py b/smart_service/apis/master_api.py index cd7b1cf..b2a8422 100644 --- a/smart_service/apis/master_api.py +++ b/smart_service/apis/master_api.py @@ -64,13 +64,13 @@ def masters(args=None, LSD=None,iid=None): if publish_type == 'Global': api = frappe.db.sql(f''' select name as vehicle,vehicle_segment,vehicle_segment_id,image,active_status,display_order, - myid as vechile_id,display_order,modified from _a9b9faaf89312ce4.tabVehicle + myid as vechile_id,display_order,modified from tabVehicle where modified > '{LSD}' and global_publish = 1; ''',as_dict=1) else: api = frappe.db.sql(f''' select name as vehicle,vehicle_segment,vehicle_segment_id,image,active_status,display_order, - myid as vechile_id,display_order,modified from _a9b9faaf89312ce4.tabVehicle + myid as vechile_id,display_order,modified from tabVehicle where modified > '{LSD}' and internal_publish = 1; ''',as_dict=1) for i in api: @@ -295,4 +295,4 @@ def check_pub_type(iid): if not device_pub_type: return False - return device_pub_type[0][0] \ No newline at end of file + return device_pub_type[0][0] diff --git a/smart_service/apis/support.py b/smart_service/apis/support.py index 07bed0a..c45e80f 100644 --- a/smart_service/apis/support.py +++ b/smart_service/apis/support.py @@ -416,19 +416,19 @@ 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():