From 0586b764802abac9012771146351a774b3db0443 Mon Sep 17 00:00:00 2001 From: Henrik Norlin Date: Mon, 17 Jun 2024 21:47:22 +0200 Subject: [PATCH] [IMP] mis_builder_budget: drilldown with default budget & account --- mis_builder/models/mis_report_instance.py | 4 +++- mis_builder_budget/models/mis_report_instance.py | 5 +++++ mis_builder_budget/readme/newsfragments/605.feature | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 mis_builder_budget/readme/newsfragments/605.feature diff --git a/mis_builder/models/mis_report_instance.py b/mis_builder/models/mis_report_instance.py index 91fa3480e..e93cb5382 100644 --- a/mis_builder/models/mis_report_instance.py +++ b/mis_builder/models/mis_report_instance.py @@ -944,6 +944,8 @@ def drilldown(self, arg): account_id, ) domain.extend(period._get_additional_move_line_filter()) + context = dict(self.env.context) + context["active_test"] = False return { "name": self._get_drilldown_action_name(arg), "domain": domain, @@ -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 diff --git a/mis_builder_budget/models/mis_report_instance.py b/mis_builder_budget/models/mis_report_instance.py index da3207ec9..0c0ed8d35 100644 --- a/mis_builder_budget/models/mis_report_instance.py +++ b/mis_builder_budget/models/mis_report_instance.py @@ -118,4 +118,9 @@ def drilldown(self, arg): "view_mode": "list", "target": "current", } + elif period.source == SRC_MIS_BUDGET_BY_ACCOUNT: + self = self.with_context( + default_budget_id=period.source_mis_budget_by_account_id.id, + default_account_id=arg.get("account_id"), + ) return super().drilldown(arg) diff --git a/mis_builder_budget/readme/newsfragments/605.feature b/mis_builder_budget/readme/newsfragments/605.feature new file mode 100644 index 000000000..cba13b16a --- /dev/null +++ b/mis_builder_budget/readme/newsfragments/605.feature @@ -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.