fix: broke cost center filter in get outstanding reference docs

(cherry picked from commit 7dfe36fdce)
This commit is contained in:
ruthra kumar
2026-03-13 14:36:00 +05:30
committed by Mergify
parent db9dc86694
commit 53e3bfbf22

View File

@@ -2556,14 +2556,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)}'"