diff --git a/runbot/models/branch.py b/runbot/models/branch.py index 098baeeb..f2faf988 100644 --- a/runbot/models/branch.py +++ b/runbot/models/branch.py @@ -135,7 +135,7 @@ class runbot_branch(models.Model): return False return True - @api.model + @api.model_create_single def create(self, vals): if not vals.get('config_id') and ('use-coverage' in (vals.get('name') or '')): coverage_config = self.env.ref('runbot.runbot_build_config_test_coverage', raise_if_not_found=False) diff --git a/runbot/models/build.py b/runbot/models/build.py index 2ee8d985..1378482c 100644 --- a/runbot/models/build.py +++ b/runbot/models/build.py @@ -198,6 +198,7 @@ class runbot_build(models.Model): def copy(self, values=None): raise UserError("Cannot duplicate build!") + @api.model_create_single def create(self, vals): branch = self.env['runbot.branch'].search([('id', '=', vals.get('branch_id', False))]) # branche 10174? if branch.no_build: diff --git a/runbot/models/build_config.py b/runbot/models/build_config.py index 17700158..08fe2da0 100644 --- a/runbot/models/build_config.py +++ b/runbot/models/build_config.py @@ -32,7 +32,7 @@ class Config(models.Model): group = fields.Many2one('runbot.build.config', 'Configuration group', help="Group of config's and config steps") group_name = fields.Char('Group name', related='group.name') - @api.model + @api.model_create_single def create(self, values): res = super(Config, self).create(values) res._check_step_ids_order() @@ -163,7 +163,7 @@ class ConfigStep(models.Model): copy._write({'protected': False}) return copy - @api.model + @api.model_create_single def create(self, values): self._check(values) return super(ConfigStep, self).create(values) @@ -574,7 +574,7 @@ class ConfigStepOrder(models.Model): def _onchange_step_id(self): self.sequence = self.step_id.default_sequence - @api.model + @api.model_create_single def create(self, values): if 'sequence' not in values and values.get('step_id'): values['sequence'] = self.env['runbot.build.config.step'].browse(values.get('step_id')).default_sequence diff --git a/runbot/models/build_error.py b/runbot/models/build_error.py index ab9041a9..0eb9d419 100644 --- a/runbot/models/build_error.py +++ b/runbot/models/build_error.py @@ -49,7 +49,7 @@ class RunbotBuildError(models.Model): if build_error.test_tags and '-' in build_error.test_tags: raise ValidationError('Build error test_tags should not be negated') - @api.model + @api.model_create_single def create(self, vals): cleaners = self.env['runbot.error.regex'].search([('re_type', '=', 'cleaning')]) content = vals.get('content') diff --git a/runbot/models/host.py b/runbot/models/host.py index f48c2361..46556b57 100644 --- a/runbot/models/host.py +++ b/runbot/models/host.py @@ -38,7 +38,7 @@ class RunboHost(models.Model): host.nb_testing = count_by_host_state[host.name].get('testing', 0) host.nb_running = count_by_host_state[host.name].get('running', 0) - @api.model + @api.model_create_single def create(self, values): if not 'disp_name' in values: values['disp_name'] = values['name']