Skip to content

Commit

Permalink
[IMP] mis_builder_budget: drilldown with default budget & account
Browse files Browse the repository at this point in the history
  • Loading branch information
norlinhenrik committed Apr 21, 2024
1 parent c56768e commit b09a487
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mis_builder/models/mis_report_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,8 @@ def drilldown(self, arg):
account_id,
)
domain.extend(period._get_additional_move_line_filter())
context = arg.get("context") or {}
context["active_test"] = False
return {
"name": self._get_drilldown_action_name(arg),
"domain": domain,
Expand All @@ -952,7 +954,7 @@ def drilldown(self, arg):
"views": [[False, "list"], [False, "form"]],
"view_mode": "list",
"target": "current",
"context": {"active_test": False},
"context": context,
}
else:
return False
Expand Down
5 changes: 5 additions & 0 deletions mis_builder_budget/models/mis_report_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,9 @@ def drilldown(self, arg):
"view_mode": "list",
"target": "current",
}
elif period.source == SRC_MIS_BUDGET_BY_ACCOUNT:
arg["context"] = {
"default_budget_id": period.source_mis_budget_by_account_id.id,
"default_account_id": arg.get("account_id"),
}
return super().drilldown(arg)
3 changes: 3 additions & 0 deletions mis_builder_budget/readme/newsfragments/605.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Drilldown to "Budget By Account Items": Pass default budget and default account.

If the budget allows items overlap, one can create new budget items in the drilldown.

0 comments on commit b09a487

Please sign in to comment.