fix: Dimension filters in accounting reports
This commit is contained in:
parent
12b45b3f2a
commit
7b2d518059
@ -194,15 +194,21 @@ $.extend(erpnext.utils, {
|
||||
add_dimensions: function(report_name, index) {
|
||||
let filters = frappe.query_reports[report_name].filters;
|
||||
|
||||
erpnext.dimension_filters.forEach((dimension) => {
|
||||
let found = filters.some(el => el.fieldname === dimension['fieldname']);
|
||||
frappe.call({
|
||||
method: "erpnext.accounts.doctype.accounting_dimension.accounting_dimension.get_dimensions",
|
||||
callback: function(r) {
|
||||
let accounting_dimensions = r.message[0];
|
||||
accounting_dimensions.forEach((dimension) => {
|
||||
let found = filters.some(el => el.fieldname === dimension['fieldname']);
|
||||
|
||||
if (!found) {
|
||||
filters.splice(index, 0 ,{
|
||||
"fieldname": dimension["fieldname"],
|
||||
"label": __(dimension["label"]),
|
||||
"fieldtype": "Link",
|
||||
"options": dimension["document_type"]
|
||||
if (!found) {
|
||||
filters.splice(index, 0 ,{
|
||||
"fieldname": dimension["fieldname"],
|
||||
"label": __(dimension["label"]),
|
||||
"fieldtype": "Link",
|
||||
"options": dimension["document_type"]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user