Merge pull request #50449 from frappe/mergify/bp/version-15-hotfix/pr-50339

fix: include cost_center and project upon accounting dimension fetch (backport #50339)
This commit is contained in:
Diptanil Saha
2025-11-11 00:10:52 +05:30
committed by GitHub
3 changed files with 19 additions and 3 deletions

View File

@@ -309,8 +309,8 @@ def get_dimensions(with_cost_center_and_project=False):
if with_cost_center_and_project: if with_cost_center_and_project:
dimension_filters.extend( dimension_filters.extend(
[ [
{"fieldname": "cost_center", "document_type": "Cost Center"}, frappe._dict({"fieldname": "cost_center", "document_type": "Cost Center"}),
{"fieldname": "project", "document_type": "Project"}, frappe._dict({"fieldname": "project", "document_type": "Project"}),
] ]
) )

View File

@@ -61,6 +61,22 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
}, },
}; };
}); });
this.frm.set_query("cost_center", "payments", () => {
return {
filters: {
company: this.frm.doc.company,
is_group: 0,
},
};
});
this.frm.set_query("cost_center", "allocation", () => {
return {
filters: {
company: this.frm.doc.company,
is_group: 0,
},
};
});
} }
refresh() { refresh() {

View File

@@ -72,7 +72,7 @@ class PaymentReconciliation(Document):
self.common_filter_conditions = [] self.common_filter_conditions = []
self.accounting_dimension_filter_conditions = [] self.accounting_dimension_filter_conditions = []
self.ple_posting_date_filter = [] self.ple_posting_date_filter = []
self.dimensions = get_dimensions()[0] self.dimensions = get_dimensions(with_cost_center_and_project=True)[0]
def load_from_db(self): def load_from_db(self):
# 'modified' attribute is required for `run_doc_method` to work properly. # 'modified' attribute is required for `run_doc_method` to work properly.