From 38f4ad3832a3567cd0e917bf27ff29a34c17cf37 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 13 Feb 2025 14:57:03 +0100 Subject: [PATCH] [FIX] runbot: fix parse log action window - Fix the model on parse_logs action window. - Add a server action on build to open its errors - Fix a bad indentation --- runbot/data/error_link.xml | 13 +++++++++++-- runbot/models/build.py | 12 ++++++++++++ runbot/models/build_error.py | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/runbot/data/error_link.xml b/runbot/data/error_link.xml index 155de13b..43290e0e 100644 --- a/runbot/data/error_link.xml +++ b/runbot/data/error_link.xml @@ -1,6 +1,6 @@ - Link build errors + Merge build errors ir.actions.server @@ -39,7 +39,7 @@ records.action_assign() - + Deduplicate Error Contents @@ -49,4 +49,13 @@ records.action_deduplicate() + + View build errors + + ir.actions.server + code + + action = records.action_view_build_errors() + + diff --git a/runbot/models/build.py b/runbot/models/build.py index 7f6edfe1..726933cb 100644 --- a/runbot/models/build.py +++ b/runbot/models/build.py @@ -1268,3 +1268,15 @@ class BuildResult(models.Model): def _parse_config(self): return set(findall(self._server("tools/config.py"), r'--[\w-]+', )) + + def action_view_build_errors(self): + errors = self.env['runbot.build.error'].browse() + for record in self: + errors |= record.error_log_ids.error_content_id.error_id + return { + "type": "ir.actions.act_window", + "res_model": "runbot.build.error", + "domain": [('id', 'in', errors.ids)], + "name": "Build errors", + "view_mode": "list,form" + } diff --git a/runbot/models/build_error.py b/runbot/models/build_error.py index 600f7912..7bb96c78 100644 --- a/runbot/models/build_error.py +++ b/runbot/models/build_error.py @@ -313,7 +313,7 @@ class BuildError(models.Model): if build_error_contents: window_action = { "type": "ir.actions.act_window", - "res_model": "runbot.build.error", + "res_model": "runbot.build.error.content", "views": [[False, "list"]], "domain": [('id', 'in', build_error_contents.ids)] }