refactor: handle dynamic dimension in order query
(cherry picked from commit 7c2cb70387)
This commit is contained in:
@@ -1688,6 +1688,12 @@ def get_orders_to_be_billed(
|
|||||||
if doc and hasattr(doc, "cost_center") and doc.cost_center:
|
if doc and hasattr(doc, "cost_center") and doc.cost_center:
|
||||||
condition = " and cost_center='%s'" % cost_center
|
condition = " and cost_center='%s'" % cost_center
|
||||||
|
|
||||||
|
# dynamic dimension filters
|
||||||
|
active_dimensions = get_dimensions()[0]
|
||||||
|
for dim in active_dimensions:
|
||||||
|
if filters.get(dim.fieldname):
|
||||||
|
condition += " and {0}='{1}'".format(dim.fieldname, filters.get(dim.fieldname))
|
||||||
|
|
||||||
if party_account_currency == company_currency:
|
if party_account_currency == company_currency:
|
||||||
grand_total_field = "base_grand_total"
|
grand_total_field = "base_grand_total"
|
||||||
rounded_total_field = "base_rounded_total"
|
rounded_total_field = "base_rounded_total"
|
||||||
|
|||||||
Reference in New Issue
Block a user