Merge pull request #53415 from ruthra-kumar/broken_cost_center_filter_in_get_outstanding_documents

fix: broke cost center filter in get outstanding reference docs
This commit is contained in:
ruthra kumar
2026-03-13 15:24:28 +05:30
committed by GitHub

View File

@@ -2558,14 +2558,9 @@ def get_orders_to_be_billed(
if not voucher_type:
return []
# Add cost center condition
doc = frappe.get_doc({"doctype": voucher_type})
condition = ""
if doc and hasattr(doc, "cost_center") and doc.cost_center:
condition = " and cost_center='%s'" % cost_center
# dynamic dimension filters
active_dimensions = get_dimensions()[0]
condition = ""
active_dimensions = get_dimensions(True)[0]
for dim in active_dimensions:
if filters.get(dim.fieldname):
condition += f" and {dim.fieldname}='{filters.get(dim.fieldname)}'"