mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-28 22:28:24 +00:00
controller and other changes
This commit is contained in:
@@ -102,9 +102,9 @@ def customer_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
def supplier_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
supp_master_name = frappe.defaults.get_user_default("supp_master_name")
|
||||
if supp_master_name == "Supplier Name":
|
||||
fields = ["name", "supplier_type"]
|
||||
fields = ["name", "supplier_group"]
|
||||
else:
|
||||
fields = ["name", "supplier_name", "supplier_type"]
|
||||
fields = ["name", "supplier_name", "supplier_group"]
|
||||
fields = ", ".join(fields)
|
||||
|
||||
return frappe.db.sql("""select {field} from `tabSupplier`
|
||||
|
||||
@@ -235,16 +235,16 @@ def based_wise_columns_query(based_on, trans):
|
||||
based_on_details["addl_tables"] = ''
|
||||
|
||||
elif based_on == 'Supplier':
|
||||
based_on_details["based_on_cols"] = ["Supplier:Link/Supplier:120", "Supplier Type:Link/Supplier Type:140"]
|
||||
based_on_details["based_on_select"] = "t1.supplier, t3.supplier_type,"
|
||||
based_on_details["based_on_cols"] = ["Supplier:Link/Supplier:120", "Supplier Group:Link/Supplier Group:140"]
|
||||
based_on_details["based_on_select"] = "t1.supplier, t3.supplier_group,"
|
||||
based_on_details["based_on_group_by"] = 't1.supplier'
|
||||
based_on_details["addl_tables"] = ',`tabSupplier` t3'
|
||||
based_on_details["addl_tables_relational_cond"] = " and t1.supplier = t3.name"
|
||||
|
||||
elif based_on == 'Supplier Type':
|
||||
based_on_details["based_on_cols"] = ["Supplier Type:Link/Supplier Type:140"]
|
||||
based_on_details["based_on_select"] = "t3.supplier_type,"
|
||||
based_on_details["based_on_group_by"] = 't3.supplier_type'
|
||||
elif based_on == 'Supplier Group':
|
||||
based_on_details["based_on_cols"] = ["Supplier Group:Link/Supplier Group:140"]
|
||||
based_on_details["based_on_select"] = "t3.supplier_group,"
|
||||
based_on_details["based_on_group_by"] = 't3.supplier_group'
|
||||
based_on_details["addl_tables"] = ',`tabSupplier` t3'
|
||||
based_on_details["addl_tables_relational_cond"] = " and t1.supplier = t3.name"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user