Browse Source

Check vehicle update global vehicle check fix

version2
venkataakhil 11 months ago
parent
commit
56c3743d30
  1. 6
      smart_service/apis/update_validation.py

6
smart_service/apis/update_validation.py

@ -95,7 +95,7 @@ def check_all_vehicle_updates(vehicle_list=None):
current_version = float(v[CUR_VERSION]) current_version = float(v[CUR_VERSION])
frappe.log_error('cur', str(current_version)) frappe.log_error('cur', str(current_version))
data1_global = frappe.db.sql('''SELECT name,format(version,2) as version,vehicle_id,language,release_description as description data1_global = frappe.db.sql('''SELECT name,format(version,2) as version,vehicle_id,language,release_description as description
FROM `tabPublish` where vehicle='{}' and language='{}' and publish_status='Published' and publish_type='Global' FROM `tabPublish` where vehicle='{}' and language='{}' and publish_status='Published'
and vehicle_status='Active' and publish_module='Automotive System' and version = (select max(version) as version and vehicle_status='Active' and publish_module='Automotive System' and version = (select max(version) as version
from `tabPublish` where publish_module='Automotive System' and publish_type='Global' from `tabPublish` where publish_module='Automotive System' and publish_type='Global'
and vehicle='{}');'''.format(v_id, lang, v_id), as_dict=1) and vehicle='{}');'''.format(v_id, lang, v_id), as_dict=1)
@ -220,7 +220,8 @@ def check_vehicle_update(vehicle_list=None):
current_version = float(v[CUR_VERSION]) current_version = float(v[CUR_VERSION])
data1_global = frappe.db.sql('''SELECT name,format(version,2) as version,vehicle_id,language FROM `tabPublish` where vehicle='{}' data1_global = frappe.db.sql('''SELECT name,format(version,2) as version,vehicle_id,language FROM `tabPublish` where vehicle='{}'
and language='{}' and publish_status='Published' and vehicle_status='Active' and publish_module='Automotive System' and language='{}' and publish_status='Published' and vehicle_status='Active' and publish_module='Automotive System'
and version = (select max(version) as version from `tabPublish` where publish_module='Automotive System' and vehicle='{}'); and version = (select max(version) as version from `tabPublish` where publish_module='Automotive System' and vehicle='{}'
and publish_type='Global');
'''.format(vehicle, l_id, vehicle), as_dict=1) '''.format(vehicle, l_id, vehicle), as_dict=1)
frappe.log_error('glbal'+str(data1_global)) frappe.log_error('glbal'+str(data1_global))
@ -548,6 +549,7 @@ def check_vehicle_update(vehicle_list=None):
else: else:
return {STATUS: 0, ERROR: "No Vehicles in criteria"} return {STATUS: 0, ERROR: "No Vehicles in criteria"}
return response return response
else: else:
response['JSON'] = {STATUS: 0, ERROR: "Data Not available"} response['JSON'] = {STATUS: 0, ERROR: "Data Not available"}

Loading…
Cancel
Save