Skip to content

Commit

Permalink
[FIX] budget_allocation: query where fund_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Saran440 committed Jul 9, 2024
1 parent 873bade commit 51ce5d3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions budget_allocation/models/budget_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class BudgetPeriod(models.Model):

def _get_where_domain(self, analytic_id, template_lines):
if template_lines._name == "budget.allocation.line":
fund_domain = (
"= {}".format(template_lines.fund_id.id)
if len(template_lines) == 1
else "in {}".format(tuple(template_lines.mapped("fund_id").ids))
)
unique_fuund_ids = template_lines.mapped("fund_id")
if len(unique_fuund_ids) > 1:
fund_domain = "in {}".format(tuple(unique_fuund_ids.ids))
else:
fund_domain = "= {}".format(unique_fuund_ids.id)
return "analytic_account_id = {} and fund_id {}".format(
analytic_id, fund_domain
)
Expand Down

0 comments on commit 51ce5d3

Please sign in to comment.