|
@ -90,7 +90,10 @@ def get_data(filters): |
|
|
variantfilter=filters['variant'] |
|
|
variantfilter=filters['variant'] |
|
|
variantfilter=variantfilter.split(".") |
|
|
variantfilter=variantfilter.split(".") |
|
|
data = frappe.db.sql("""SELECT date as date, device_id, device_type, module_id, vehicle_id, variant_id,variant_mapping_id, system_id, sub_system_id, |
|
|
data = frappe.db.sql("""SELECT date as date, device_id, device_type, module_id, vehicle_id, variant_id,variant_mapping_id, system_id, sub_system_id, |
|
|
procedure_id, steps_id, count(*) as count, user_id, language FROM {0}.`tabModel Usage` WHERE vehicle_id='{1}' and variant_id='{2}' |
|
|
procedure_id, steps_id, count(*) as count, user_id, language, |
|
|
|
|
|
login_name,concat(first_name,' ',last_name) as user_name |
|
|
|
|
|
FROM `tabModel Usage` mu left join `tabApp Users` au on mu.user_id = au.user_id |
|
|
|
|
|
WHERE vehicle_id='{1}' and variant_id='{2}' |
|
|
and (date(date) between '{3}' and '{4}') GROUP BY date(date), user_id, module_id, device_id, vehicle_id, variant_id, variant_mapping_id, |
|
|
and (date(date) between '{3}' and '{4}') GROUP BY date(date), user_id, module_id, device_id, vehicle_id, variant_id, variant_mapping_id, |
|
|
system_id, sub_system_id, procedure_id, steps_id, language |
|
|
system_id, sub_system_id, procedure_id, steps_id, language |
|
|
order by module_id,vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id,language; |
|
|
order by module_id,vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id,language; |
|
@ -119,6 +122,8 @@ def get_data(filters): |
|
|
def get_columns(): |
|
|
def get_columns(): |
|
|
columns = [ |
|
|
columns = [ |
|
|
{"label": _("<b>Date</b>"), "fieldname": "date", "fieldtype": "Date", "width": 150}, |
|
|
{"label": _("<b>Date</b>"), "fieldname": "date", "fieldtype": "Date", "width": 150}, |
|
|
|
|
|
{"label": _("<b>User ID</b>"), "fieldname": "login_name", "fieldtype": "Data", "width": 125}, |
|
|
|
|
|
{"label": _("<b>User Name</b>"), "fieldname": "user_name", "fieldtype": "Data", "width": 125}, |
|
|
{"label": _("<b>Model</b>"), "fieldname": "vehicle_id", "fieldtype": "Data", "width": 150}, |
|
|
{"label": _("<b>Model</b>"), "fieldname": "vehicle_id", "fieldtype": "Data", "width": 150}, |
|
|
{"label": _("<b>Variant Mapping</b>"), "fieldname": "variant_mapping_id", "fieldtype": "Data", "width": 150}, |
|
|
{"label": _("<b>Variant Mapping</b>"), "fieldname": "variant_mapping_id", "fieldtype": "Data", "width": 150}, |
|
|
{"label": _("<b>Variant</b>"), "fieldname": "variant_id", "fieldtype": "Data", "width": 80}, |
|
|
{"label": _("<b>Variant</b>"), "fieldname": "variant_id", "fieldtype": "Data", "width": 80}, |
|
@ -129,6 +134,7 @@ def get_columns(): |
|
|
{"label": _("<b>Steps</b>"), "fieldname": "steps_id", "fieldtype": "Data", "width": 150}, |
|
|
{"label": _("<b>Steps</b>"), "fieldname": "steps_id", "fieldtype": "Data", "width": 150}, |
|
|
{"label": _("<b>Language</b>"), "fieldname": "language", "fieldtype": "Data", "width": 80}, |
|
|
{"label": _("<b>Language</b>"), "fieldname": "language", "fieldtype": "Data", "width": 80}, |
|
|
{"label": _("<b>Count</b>"), "fieldname": "count", "fieldtype": "Data", "width": 80}, |
|
|
{"label": _("<b>Count</b>"), "fieldname": "count", "fieldtype": "Data", "width": 80}, |
|
|
|
|
|
|
|
|
# {"label": _("<b>Zone</b>"), "fieldname": "zone", "fieldtype": "Data", "width": 150}, |
|
|
# {"label": _("<b>Zone</b>"), "fieldname": "zone", "fieldtype": "Data", "width": 150}, |
|
|
# {"label": _("<b>Area Office</b>"), "fieldname": "area", "fieldtype": "Data", "width": 150}, |
|
|
# {"label": _("<b>Area Office</b>"), "fieldname": "area", "fieldtype": "Data", "width": 150}, |
|
|
# {"label": _("<b>Dealer Code</b>"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 150}, |
|
|
# {"label": _("<b>Dealer Code</b>"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 150}, |
|
|