@@ -172,8 +172,8 @@ class BuildResult(models.Model):
172
172
173
173
requested_action = fields .Selection ([('wake_up' , 'To wake up' ), ('deathrow' , 'To kill' )], string = 'Action requested' , index = True )
174
174
# web infos
175
- host = fields .Char ('Host name' )
176
- host_id = fields .Many2one ('runbot.host' , string = "Host" , compute = '_compute_host_id' )
175
+ host = fields .Char ('Host name' , index = True )
176
+ host_id = fields .Many2one ('runbot.host' , string = "Host" , compute = '_compute_host_id' , search = "_search_host_id" )
177
177
keep_host = fields .Boolean ('Keep host on rebuild and for children' )
178
178
179
179
port = fields .Integer ('Port' )
@@ -252,6 +252,12 @@ def _compute_host_id(self):
252
252
for record in self :
253
253
record .host_id = get_host (record .host )
254
254
255
+ def _search_host_id (self , operator , value ):
256
+ names = self .env ['runbot.host' ].browse (value ).mapped ('name' )
257
+ if isinstance (value , int ):
258
+ names = names [0 ]
259
+ return [('host' , operator , names )]
260
+
255
261
@api .depends ('children_ids.global_state' , 'local_state' )
256
262
def _compute_global_state (self ):
257
263
for record in self :
@@ -969,8 +975,6 @@ def _local_pg_dropdb(self, dbname):
969
975
except Exception as e :
970
976
msg = f"Failed to drop local logs database : { dbname } with exception: { e } "
971
977
_logger .exception (msg )
972
- host_name = self .env ['runbot.host' ]._get_current_name ()
973
- self .env ['runbot.runbot' ]._warning (f'Host { host_name } : { msg } ' )
974
978
975
979
def _local_pg_createdb (self , dbname ):
976
980
icp = self .env ['ir.config_parameter' ]
0 commit comments