[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.
This commit is contained in:
Xavier-Do 2025-03-14 12:12:45 +01:00 committed by xdo
parent 9097aa4545
commit 3aeaa5220e

View File

@ -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):