From 1143d83184cba16a46138df4245f35fdb7fd5eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Tue, 28 Jun 2022 23:04:01 +0200 Subject: [PATCH] [UPD] Add button to list budget line's linked analytic lines --- account_budget_forecast/models/budget_forecast.py | 7 +++++++ account_budget_forecast/views/budget_forecast.xml | 14 +++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/account_budget_forecast/models/budget_forecast.py b/account_budget_forecast/models/budget_forecast.py index 0d4182c..9909e85 100644 --- a/account_budget_forecast/models/budget_forecast.py +++ b/account_budget_forecast/models/budget_forecast.py @@ -446,3 +446,10 @@ class BudgetForecast(models.Model): record.balance = None record.diff_expenses = record.plan_amount_with_coeff - record.actual_amount + + def action_view_analytic_lines(self): + action = self.env["ir.actions.actions"]._for_xml_id( + "analytic.account_analytic_line_action_entries" + ) + action["domain"] = [("tag_ids", "ilike", self.analytic_tag.id)] + return action diff --git a/account_budget_forecast/views/budget_forecast.xml b/account_budget_forecast/views/budget_forecast.xml index 7534ee4..41e3f70 100644 --- a/account_budget_forecast/views/budget_forecast.xml +++ b/account_budget_forecast/views/budget_forecast.xml @@ -38,17 +38,9 @@ - - +