fix: correct set_query filters

This commit is contained in:
Smit Vora 2023-09-11 19:16:25 +05:30
parent c47adcfdd9
commit 43061f4416
6 changed files with 8 additions and 3 deletions

View File

@ -24,7 +24,8 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
filters: { filters: {
"company": this.frm.doc.company, "company": this.frm.doc.company,
"is_group": 0, "is_group": 0,
"account_type": frappe.boot.party_account_types[this.frm.doc.party_type] "account_type": frappe.boot.party_account_types[this.frm.doc.party_type],
"root_type": this.frm.doc.party_type == 'Customer' ? "Asset" : "Liability"
} }
}; };
}); });

View File

@ -12,6 +12,7 @@ frappe.ui.form.on("Supplier", {
return { return {
filters: { filters: {
'account_type': 'Payable', 'account_type': 'Payable',
'root_type': 'Liability',
'company': d.company, 'company': d.company,
"is_group": 0 "is_group": 0
} }

View File

@ -23,6 +23,7 @@ frappe.ui.form.on("Customer", {
let d = locals[cdt][cdn]; let d = locals[cdt][cdn];
let filters = { let filters = {
'account_type': 'Receivable', 'account_type': 'Receivable',
'root_type': 'Asset',
'company': d.company, 'company': d.company,
"is_group": 0 "is_group": 0
}; };

View File

@ -200,8 +200,8 @@ erpnext.company.setup_queries = function(frm) {
$.each([ $.each([
["default_bank_account", {"account_type": "Bank"}], ["default_bank_account", {"account_type": "Bank"}],
["default_cash_account", {"account_type": "Cash"}], ["default_cash_account", {"account_type": "Cash"}],
["default_receivable_account", {"account_type": "Receivable"}], ["default_receivable_account", { "root_type": "Asset", "account_type": "Receivable" }],
["default_payable_account", {"account_type": "Payable"}], ["default_payable_account", { "root_type": "Liability", "account_type": "Payable" }],
["default_expense_account", {"root_type": "Expense"}], ["default_expense_account", {"root_type": "Expense"}],
["default_income_account", {"root_type": "Income"}], ["default_income_account", {"root_type": "Income"}],
["round_off_account", {"root_type": "Expense"}], ["round_off_account", {"root_type": "Expense"}],

View File

@ -30,6 +30,7 @@ frappe.ui.form.on("Customer Group", {
frm.set_query('account', 'accounts', function (doc, cdt, cdn) { frm.set_query('account', 'accounts', function (doc, cdt, cdn) {
return { return {
filters: { filters: {
'root_type': 'Asset',
"account_type": 'Receivable', "account_type": 'Receivable',
"company": locals[cdt][cdn].company, "company": locals[cdt][cdn].company,
"is_group": 0 "is_group": 0

View File

@ -30,6 +30,7 @@ frappe.ui.form.on("Supplier Group", {
frm.set_query('account', 'accounts', function (doc, cdt, cdn) { frm.set_query('account', 'accounts', function (doc, cdt, cdn) {
return { return {
filters: { filters: {
'root_type': 'Liability',
'account_type': 'Payable', 'account_type': 'Payable',
'company': locals[cdt][cdn].company, 'company': locals[cdt][cdn].company,
"is_group": 0 "is_group": 0