Browse Source

Translation reports order by desc for drive, fuel, system,subsystem,transmission,variant,vehicle,vehicle segment

master
administrator 11 months ago
parent
commit
4db3d899e1
  1. 2
      smart_service/masters/report/drive_translation/drive_translation.py
  2. 2
      smart_service/masters/report/fuel_translation/fuel_translation.py
  3. 2
      smart_service/masters/report/sub_systems_translation/sub_systems_translation.py
  4. 2
      smart_service/masters/report/systems_translation/systems_translation.py
  5. 2
      smart_service/masters/report/transmission_translation/transmission_translation.py
  6. 4
      smart_service/masters/report/variant_translation/variant_translation.py
  7. 7
      smart_service/masters/report/vehicle_segment_translation/vehicle_segment_translation.py
  8. 2
      smart_service/masters/report/vehicle_translation/vehicle_translation.py

2
smart_service/masters/report/drive_translation/drive_translation.py

@ -47,7 +47,7 @@ def get_data():
, tanLang.language_code as languageCode , tanLang.language_code as languageCode
FROM %s.tabLanguage as tanLang) as tabLang FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabDrive`.drive = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) ON %s.`tabDrive`.drive = tabTranslation.sourceText ORDER BY `tabDrive`.modified DESC;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True) data = frappe.db.sql(actualQuery,as_list=True)

2
smart_service/masters/report/fuel_translation/fuel_translation.py

@ -46,7 +46,7 @@ def get_data():
, tanLang.language_code as languageCode , tanLang.language_code as languageCode
FROM tabLanguage as tanLang) as tabLang FROM tabLanguage as tanLang) as tabLang
ON tabTranslation.language = tabLang.languageCode) as tabTranslation ON tabTranslation.language = tabLang.languageCode) as tabTranslation
ON `tabFuel`.fuel = tabTranslation.sourceText;""" % (sel ,queryAppendLang) ON `tabFuel`.fuel = tabTranslation.sourceText ORDER BY `tabFuel`.modified DESC;""" % (sel ,queryAppendLang)
data = frappe.db.sql(actualQuery,as_list=True) data = frappe.db.sql(actualQuery,as_list=True)

2
smart_service/masters/report/sub_systems_translation/sub_systems_translation.py

@ -48,7 +48,7 @@ def get_data():
, tanLang.language_code as languageCode , tanLang.language_code as languageCode
FROM {0}.tabLanguage as tanLang) as tabLang FROM {0}.tabLanguage as tanLang) as tabLang
ON {0}.tabTranslation.language = tabLang.languageCode) as tabTranslation ON {0}.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON {0}.`tabSub Systems`.sub_system_name = tabTranslation.sourceText;""" .format(current_db_name,sel ,queryAppendLang) ON {0}.`tabSub Systems`.sub_system_name = tabTranslation.sourceText ORDER BY `tabSub Systems`.modified DESC;""" .format(current_db_name,sel ,queryAppendLang)
data = frappe.db.sql(actualQuery,as_list=True) data = frappe.db.sql(actualQuery,as_list=True)

2
smart_service/masters/report/systems_translation/systems_translation.py

@ -47,7 +47,7 @@ def get_data():
, tanLang.language_code as languageCode , tanLang.language_code as languageCode
FROM %s.tabLanguage as tanLang) as tabLang FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabSystems`.system_name = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) ON %s.`tabSystems`.system_name = tabTranslation.sourceText ORDER BY `tabSystems`.modified DESC;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True) data = frappe.db.sql(actualQuery,as_list=True)

2
smart_service/masters/report/transmission_translation/transmission_translation.py

@ -45,7 +45,7 @@ def get_data():
, tanLang.language_code as languageCode , tanLang.language_code as languageCode
FROM %s.tabLanguage as tanLang) as tabLang FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabTransmission`.transmission = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) ON %s.`tabTransmission`.transmission = tabTranslation.sourceText ORDER BY `tabTransmission`.modified DESC;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True) data = frappe.db.sql(actualQuery,as_list=True)

4
smart_service/masters/report/variant_translation/variant_translation.py

@ -47,7 +47,7 @@ def get_data():
, tanLang.language_code as languageCode , tanLang.language_code as languageCode
FROM tabLanguage as tanLang) as tabLang FROM tabLanguage as tanLang) as tabLang
ON tabTranslation.language = tabLang.languageCode) as tabTranslation ON tabTranslation.language = tabLang.languageCode) as tabTranslation
ON `tabVariant`.variant = tabTranslation.sourceText;""" % (sel ,queryAppendLang) ON `tabVariant`.variant = tabTranslation.sourceText ORDER BY `tabVariant`.modified DESC;""" % (sel ,queryAppendLang)
data = frappe.db.sql(actualQuery,as_list=True) data = frappe.db.sql(actualQuery,as_list=True)
return data return data
@ -57,7 +57,7 @@ def get_columns():
columns = [] columns = []
columns += [ columns += [
_("<b>Modified On</b>") + ":Data/:240", _("<b>Status</b>") + ":Data/:100", _("<b>Vehicle</b>") + ":Data/:200",_("<b>Variant</b>") + ":Data/:220", _("<b>Modified On</b>") + ":Datetime/:240", _("<b>Status</b>") + ":Data/:100", _("<b>Vehicle</b>") + ":Data/:200",_("<b>Variant</b>") + ":Data/:220",
] ]
lang = [] lang = []
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1) custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1)

7
smart_service/masters/report/vehicle_segment_translation/vehicle_segment_translation.py

@ -16,7 +16,7 @@ def execute(filters=None):
return columns, data return columns, data
def get_data(): def get_data():
try:
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True) custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True)
@ -50,11 +50,14 @@ def get_data():
, tanLang.language_code as languageCode , tanLang.language_code as languageCode
FROM %s.tabLanguage as tanLang) as tabLang FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabVehicle Segment`.vehicle_segment = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) ON %s.`tabVehicle Segment`.vehicle_segment = tabTranslation.sourceText ORDER BY `tabVehicle Segment`.modified DESC;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True) data = frappe.db.sql(actualQuery,as_list=True)
return data return data
except Exception as e:
frappe.throw(str(frappe.get_traceback()))
def get_columns(): def get_columns():

2
smart_service/masters/report/vehicle_translation/vehicle_translation.py

@ -45,7 +45,7 @@ def get_data():
, tanLang.language_code as languageCode , tanLang.language_code as languageCode
FROM %s.tabLanguage as tanLang) as tabLang FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabVehicle`.vehicle = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) ON %s.`tabVehicle`.vehicle = tabTranslation.sourceText ORDER BY `tabVehicle`.modified DESC;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True) data = frappe.db.sql(actualQuery,as_list=True)

Loading…
Cancel
Save