Browse Source

vehicle master fix

master
Jecintha 1 year ago
parent
commit
7516d15a5f
  1. 6
      smart_service/apis/master_api.py
  2. 26
      smart_service/apis/support.py

6
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]
return device_pub_type[0][0]

26
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():

Loading…
Cancel
Save