diff --git a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py index cdaaa6dd069..02019943c25 100644 --- a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py +++ b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py @@ -309,8 +309,8 @@ def get_dimensions(with_cost_center_and_project=False): if with_cost_center_and_project: dimension_filters.extend( [ - {"fieldname": "cost_center", "document_type": "Cost Center"}, - {"fieldname": "project", "document_type": "Project"}, + frappe._dict({"fieldname": "cost_center", "document_type": "Cost Center"}), + frappe._dict({"fieldname": "project", "document_type": "Project"}), ] ) diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js index 75a86318fbb..74a9f709caa 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js @@ -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() { diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index 1e1a71ea707..2dec2bf8e94 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -72,7 +72,7 @@ class PaymentReconciliation(Document): self.common_filter_conditions = [] self.accounting_dimension_filter_conditions = [] 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): # 'modified' attribute is required for `run_doc_method` to work properly.