From 8eeb838805e65219cda90d3fac14a94a11041316 Mon Sep 17 00:00:00 2001 From: lse-odoo Date: Mon, 3 Mar 2025 16:21:09 +0100 Subject: [PATCH] [ADD] runbot: smart button on build errors for build links list Before this commit: The only way to have details on the builds was to use the embed one2many widget in the build error form view. This was pretty inconvenient for complicated search as there is no way to filter the records or group them After this commit: A list view now exist for the model `runbot.build.error.link` allowing to filter and group on convenient fields. This list view can be accessed on the runbot build error through a smart button --- runbot/__manifest__.py | 1 + runbot/models/build_error.py | 10 +++++ runbot/views/build_error_link_views.xml | 50 +++++++++++++++++++++++++ runbot/views/build_error_views.xml | 30 ++++----------- 4 files changed, 68 insertions(+), 23 deletions(-) create mode 100644 runbot/views/build_error_link_views.xml diff --git a/runbot/__manifest__.py b/runbot/__manifest__.py index eab898c6..ad37f5c7 100644 --- a/runbot/__manifest__.py +++ b/runbot/__manifest__.py @@ -38,6 +38,7 @@ 'templates/build_error.xml', 'views/branch_views.xml', + 'views/build_error_link_views.xml', 'views/build_error_views.xml', 'views/build_views.xml', 'views/bundle_views.xml', diff --git a/runbot/models/build_error.py b/runbot/models/build_error.py index f307330c..3288030c 100644 --- a/runbot/models/build_error.py +++ b/runbot/models/build_error.py @@ -322,6 +322,16 @@ class BuildError(models.Model): self.ensure_one() return Markup('%s') % (self._get_form_url(), self.id) + def action_get_build_link_record(self): + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'view_mode': 'list,form,pivot', + 'res_model': 'runbot.build.error.link', + 'domain': [('id', 'in', self.unique_build_error_link_ids.ids)], + 'context': "{'create': False}" + } + def action_view_errors(self): return { 'type': 'ir.actions.act_window', diff --git a/runbot/views/build_error_link_views.xml b/runbot/views/build_error_link_views.xml new file mode 100644 index 00000000..5bf715ac --- /dev/null +++ b/runbot/views/build_error_link_views.xml @@ -0,0 +1,50 @@ + + + Runbot Build Error Link List + runbot.build.error.link + + + + + + + + + + + + + + + + Runbot Build Error Link Search + runbot.build.error.link + + + + + + + + + + + + + + + + + + + + + + + + + Runbot Build Error Link + runbot.build.error.link + list,pivot,form + + diff --git a/runbot/views/build_error_views.xml b/runbot/views/build_error_views.xml index 7aaec957..8427f974 100644 --- a/runbot/views/build_error_views.xml +++ b/runbot/views/build_error_views.xml @@ -6,6 +6,11 @@
+
+ +