Browse Source

KM Mapping merge fix

version2
venkataakhil 12 months ago
parent
commit
1b884ab2f7
  1. 7
      smart_service/transactions/doctype/kilometer_mapping/kilometer_mapping.py

7
smart_service/transactions/doctype/kilometer_mapping/kilometer_mapping.py

@ -5,7 +5,6 @@ import frappe
from frappe.model.document import Document from frappe.model.document import Document
import sys import sys
from frappe import _ from frappe import _
<<<<<<< HEAD
sys.tracebacklimit = 0 sys.tracebacklimit = 0
@ -32,7 +31,6 @@ def get_system(doc):
return system return system
=======
sys.tracebacklimit=0 sys.tracebacklimit=0
current_db_name = frappe.conf.get("db_name") current_db_name = frappe.conf.get("db_name")
class KilometerMapping(Document): class KilometerMapping(Document):
@ -53,7 +51,6 @@ def get_system(doc):
system = frappe.db.sql("""select sub_systems,mat from {0}.`tabSystem Mapping_Sub System` where parent = '{1}' and procedure_is_published = '0'""".format(current_db_name,s.name),as_dict=True) system = frappe.db.sql("""select sub_systems,mat from {0}.`tabSystem Mapping_Sub System` where parent = '{1}' and procedure_is_published = '0'""".format(current_db_name,s.name),as_dict=True)
return system return system
>>>>>>> bb4600bece5c8a0a27d7e8515d386801fc23a646
@frappe.whitelist() @frappe.whitelist()
def get_subsystem(doc): def get_subsystem(doc):
current_db_name = frappe.conf.get("db_name") current_db_name = frappe.conf.get("db_name")
@ -86,7 +83,6 @@ def update_duplicate_km(doc, kilometer):
@frappe.whitelist() @frappe.whitelist()
<<<<<<< HEAD
def get_config_kilometer(doc, docname): def get_config_kilometer(doc, docname):
res = frappe.db.sql( res = frappe.db.sql(
f"""select kilometer,mat,sub_systems,applicable,row_name from `tabKilometer Mapping_Items` where parent='{doc}'""", as_dict=1) f"""select kilometer,mat,sub_systems,applicable,row_name from `tabKilometer Mapping_Items` where parent='{doc}'""", as_dict=1)
@ -98,7 +94,7 @@ def get_config_kilometer(doc, docname):
ress.save() ress.save()
frappe.db.commit() frappe.db.commit()
return {"status": "success"} return {"status": "success"}
=======
def get_config_kilometer(doc,docname): def get_config_kilometer(doc,docname):
res = frappe.db.sql(f"""select kilometer,mat,sub_systems,applicable,row_name from `tabKilometer Mapping_Items` where parent='{doc}'""",as_dict=1) res = frappe.db.sql(f"""select kilometer,mat,sub_systems,applicable,row_name from `tabKilometer Mapping_Items` where parent='{doc}'""",as_dict=1)
ress = frappe.get_doc("Kilometer Mapping",docname) ress = frappe.get_doc("Kilometer Mapping",docname)
@ -123,4 +119,3 @@ def get_config_kilometer(doc,docname):
# km_filters =frappe.db.sql(f"""select * from `tabKilometer Mapping_Items` where parent ="{parent}" and kilometer ="{km}" order by length(kilometer),kilometer """,as_dict = 1) # km_filters =frappe.db.sql(f"""select * from `tabKilometer Mapping_Items` where parent ="{parent}" and kilometer ="{km}" order by length(kilometer),kilometer """,as_dict = 1)
# return km_filters # return km_filters
>>>>>>> bb4600bece5c8a0a27d7e8515d386801fc23a646

Loading…
Cancel
Save