Merge pull request #22478 from michellealva/cost_center_filter

fix: apply filters in all transactions
This commit is contained in:
rohitwaghchaure 2020-06-28 15:10:13 +05:30 committed by GitHub
commit 41cd4fc788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,6 +159,26 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
};
});
}
if (this.frm.fields_dict["items"].grid.get_field("cost_center")) {
this.frm.set_query("cost_center", "items", function(doc) {
return {
filters: {
"company": doc.company,
"is_group": 0
}
};
});
}
if (this.frm.fields_dict["items"].grid.get_field("expense_account")) {
this.frm.set_query("expense_account", "items", function(doc) {
return {
filters: {
"company": doc.company
}
};
});
}
if(frappe.meta.get_docfield(this.frm.doc.doctype, "pricing_rules")) {
this.frm.set_indicator_formatter('pricing_rule', function(doc) {