[REF] runbot: use selection_add

This commit is contained in:
Xavier-Do 2020-01-02 16:54:02 +01:00
parent df157f7742
commit 1069598616
2 changed files with 3 additions and 3 deletions

View File

@ -57,9 +57,9 @@ class runbot_build(models.Model):
# state machine
global_state = fields.Selection(make_selection(state_order), string='Status', compute='_compute_global_state', store=True)
local_state = fields.Selection(make_selection(state_order), string='Build Status', default='pending', required=True, oldname='state', index=True)
local_state = fields.Selection(make_selection(state_order), string='Build Status', default='pending', required=True, index=True)
global_result = fields.Selection(make_selection(result_order), string='Result', compute='_compute_global_result', store=True)
local_result = fields.Selection(make_selection(result_order), string='Build Result', oldname='result')
local_result = fields.Selection(make_selection(result_order), string='Build Result')
triggered_result = fields.Selection(make_selection(result_order), string='Triggered Result') # triggered by db only
requested_action = fields.Selection([('wake_up', 'To wake up'), ('deathrow', 'To kill')], string='Action requested', index=True)

View File

@ -16,7 +16,7 @@ class runbot_event(models.Model):
build_id = fields.Many2one('runbot.build', 'Build', index=True, ondelete='cascade')
active_step_id = fields.Many2one('runbot.build.config.step', 'Active step', index=True)
type = fields.Selection(TYPES, string='Type', required=True, index=True)
type = fields.Selection(selection_add=TYPES, string='Type', required=True, index=True)
def init(self):
parent_class = super(runbot_event, self)