|
@ -267,6 +267,8 @@ def masters(args=None, LSD=None,iid=None): |
|
|
temp_api = frappe.get_doc( |
|
|
temp_api = frappe.get_doc( |
|
|
"App Preference", |
|
|
"App Preference", |
|
|
) |
|
|
) |
|
|
|
|
|
time_val = datetime.datetime.strptime( |
|
|
|
|
|
temp_api.auto_logout_time, '%H:%M:%S') |
|
|
api = { |
|
|
api = { |
|
|
"application_server_url": temp_api.application_server_url, |
|
|
"application_server_url": temp_api.application_server_url, |
|
|
"update_server_url": temp_api.update_server_url, |
|
|
"update_server_url": temp_api.update_server_url, |
|
@ -275,7 +277,7 @@ def masters(args=None, LSD=None,iid=None): |
|
|
"masters_base_url": temp_api.masters_base_url, |
|
|
"masters_base_url": temp_api.masters_base_url, |
|
|
"transactions_base_url": temp_api.transactions_base_url, |
|
|
"transactions_base_url": temp_api.transactions_base_url, |
|
|
"addons_base_url": temp_api.addons_base_url, |
|
|
"addons_base_url": temp_api.addons_base_url, |
|
|
"auto_logout_time": temp_api.auto_logout_time |
|
|
"auto_logout_time": time_val.strftime('%H:%M:%S.%f') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
else: |
|
|
else: |
|
@ -296,3 +298,21 @@ 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] |
|
|
|
|
|
|
|
|
|
|
|
@frappe.whitelist(methods=['POST']) |
|
|
|
|
|
def variant(LSD): |
|
|
|
|
|
date_format = "%Y-%m-%d %H:%M:%S.%f" |
|
|
|
|
|
if LSD != "": |
|
|
|
|
|
try: |
|
|
|
|
|
datetime.datetime.strptime(LSD, date_format) |
|
|
|
|
|
except: |
|
|
|
|
|
return {"status": 0, "error": " 'LSD' format error"} |
|
|
|
|
|
try: |
|
|
|
|
|
data = frappe.db.sql(''' |
|
|
|
|
|
select v.myid as variant_id,vm.name,vm.vehicle,vm.variant,vm.fuel,vm.transmission,vm.drive,vm.active_status |
|
|
|
|
|
FROM `tabVariant Mapping` vm left join tabVariant v on v.name = vm.variant where vm.modified >='';''', as_dict=1) |
|
|
|
|
|
return {"status": 1, "error": None, 'data': data} |
|
|
|
|
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
|
|
frappe.local.response['http_status_code'] = 400 |
|
|
|
|
|
return {"status": 0, "error": e, 'data': None} |