mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 11:44:11 +00:00
fix(purchase invoice): filter only enabled account
(cherry picked from commit c3111db6e2)
This commit is contained in:
@@ -29,7 +29,10 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
|||||||
this.frm.set_query("expense_account", "items", function () {
|
this.frm.set_query("expense_account", "items", function () {
|
||||||
return {
|
return {
|
||||||
query: "erpnext.controllers.queries.get_expense_account",
|
query: "erpnext.controllers.queries.get_expense_account",
|
||||||
filters: { company: doc.company },
|
filters: {
|
||||||
|
company: doc.company,
|
||||||
|
disabled: 0,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -640,6 +640,7 @@ def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
condition = ""
|
condition = ""
|
||||||
if filters.get("company"):
|
if filters.get("company"):
|
||||||
condition += "and tabAccount.company = %(company)s"
|
condition += "and tabAccount.company = %(company)s"
|
||||||
|
condition += f"and tabAccount.disabled = {filters.get('disabled', 0)}"
|
||||||
|
|
||||||
return frappe.db.sql(
|
return frappe.db.sql(
|
||||||
f"""select tabAccount.name from `tabAccount`
|
f"""select tabAccount.name from `tabAccount`
|
||||||
|
|||||||
Reference in New Issue
Block a user