From 4fc7f1637e2ffb4d268b9aa8495076922c80db48 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Fri, 14 Mar 2025 12:12:45 +0100 Subject: [PATCH] [IMP] runbot: improve host form view loading speedup The host form view was loading slowly because of the domain != "done" whitch doesn't benefit from any index. Switching it to a list of state that are not done solves the issue. --- runbot/models/host.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot/models/host.py b/runbot/models/host.py index 8db11c3a..fe56f927 100644 --- a/runbot/models/host.py +++ b/runbot/models/host.py @@ -63,7 +63,7 @@ class Host(models.Model): def _compute_build_ids(self): for host in self: - host.build_ids = self.env['runbot.build'].search([('host', '=', host.name), ('local_state', '!=', 'done')]) + host.build_ids = self.env['runbot.build'].search([('host', '=', host.name), ('local_state', 'in', ('pending', 'testing', 'running'))]) @api.model_create_multi def create(self, vals_list):