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': if publish_type == 'Global':
api = frappe.db.sql(f''' api = frappe.db.sql(f'''
select name as vehicle,vehicle_segment,vehicle_segment_id,image,active_status,display_order, 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; where modified > '{LSD}' and global_publish = 1;
''',as_dict=1) ''',as_dict=1)
else: else:
api = frappe.db.sql(f''' api = frappe.db.sql(f'''
select name as vehicle,vehicle_segment,vehicle_segment_id,image,active_status,display_order, 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; where modified > '{LSD}' and internal_publish = 1;
''',as_dict=1) ''',as_dict=1)
for i in api: for i in api:
@ -295,4 +295,4 @@ def check_pub_type(iid):
if not device_pub_type: if not device_pub_type:
return False 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 return False
# @frappe.whitelist(allow_guest=1) @frappe.whitelist(allow_guest=1)
# def clear_procedures(): def clear_procedures():
# try: try:
# set_procedure_false()
# frappe.db.sql('''delete FROM `tabPublish`;''') set_procedure_false()
# frappe.db.sql('''delete FROM `tabPublish_Docs`;''') 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 `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_Sub System` set procedure_is_published=0;''')
# frappe.db.sql('''update `tabSystem Mapping_System Assets` set published=0;''') frappe.db.sql('''update `tabSystem Mapping_System Assets` set published=0;''')
# frappe.db.commit() frappe.db.commit()
# except Exception as e: except Exception as e:
# return e return e
@frappe.whitelist(allow_guest=1) @frappe.whitelist(allow_guest=1)
def circular_api(): def circular_api():

Loading…
Cancel
Save