[IMP] runbot: add a reassign team wizard

This commit is contained in:
Christophe Monniez 2022-12-21 10:50:34 +01:00 committed by xdo
parent c83f89fc23
commit 9ccf5a2c0e
3 changed files with 52 additions and 5 deletions

View File

@ -280,3 +280,19 @@ class ErrorClosingWizard(models.TransientModel):
for build_error in error_ids:
build_error.message_post(body=self.reason, subject="Closing Error")
error_ids['active'] = False
class ErrorReassignWizard(models.TransientModel):
_name = 'runbot.error.reassign.wizard'
_description = "Errors reassign Wizard"
team_id = fields.Many2one('runbot.team', 'Assigned team')
responsible_id = fields.Many2one('res.users', 'Assigned fixer')
def submit(self):
error_ids = self.env['runbot.build.error'].browse(self.env.context.get('active_ids'))
if error_ids:
if self.team_id:
error_ids['team_id'] = self.team_id
if self.responsible_id:
error_ids['responsible'] = self.responsible_id

View File

@ -30,6 +30,8 @@ access_runbot_team_team_manager,runbot_team_team_manager,runbot.model_runbot_tea
access_runbot_team_user,runbot_team_user,runbot.model_runbot_team,group_user,1,0,0,0
access_runbot_error_closing_wizard_admin,access_runbot_error_closing_wizard_admin,runbot.model_runbot_error_closing_wizard,runbot.group_runbot_admin,1,1,1,1
access_runbot_error_closing_wizard_manager,access_runbot_error_closing_wizard_manager,runbot.model_runbot_error_closing_wizard,runbot.group_runbot_error_manager,1,1,1,1
access_runbot_error_reassign_wizard_admin,access_runbot_error_reassign_wizard_admin,runbot.model_runbot_error_reassign_wizard,runbot.group_runbot_admin,1,1,1,1
access_runbot_error_reassign_wizard_manager,access_runbot_error_reassign_wizard_manager,runbot.model_runbot_error_reassign_wizard,runbot.group_runbot_error_manager,1,1,1,1
access_runbot_module_admin,runbot_module_admin,runbot.model_runbot_module,runbot.group_runbot_admin,1,1,1,1
access_runbot_module_team_manager,runbot_module_team_manager,runbot.model_runbot_module,runbot.group_runbot_team_manager,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
30 access_runbot_module_user access_runbot_module_admin runbot_module_user runbot_module_admin runbot.model_runbot_module group_user runbot.group_runbot_admin 1 0 1 0 1 0 1
31 access_runbot_module_ownership_admin access_runbot_module_team_manager runbot_module_ownership_admin runbot_module_team_manager runbot.model_runbot_module_ownership runbot.model_runbot_module runbot.group_runbot_admin runbot.group_runbot_team_manager 1 1 1 1
32 access_runbot_module_ownership__team_manager access_runbot_module_user runbot_module_ownership_team_manager runbot_module_user runbot.model_runbot_module_ownership runbot.model_runbot_module runbot.group_runbot_team_manager group_user 1 1 0 1 0 1 0
33 access_runbot_module_ownership_admin runbot_module_ownership_admin runbot.model_runbot_module_ownership runbot.group_runbot_admin 1 1 1 1
34 access_runbot_module_ownership__team_manager runbot_module_ownership_team_manager runbot.model_runbot_module_ownership runbot.group_runbot_team_manager 1 1 1 1
35 access_runbot_module_ownership_user runbot_module_ownership_user runbot.model_runbot_module_ownership group_user 1 0 0 0
36 access_runbot_dashboard_admin runbot_dashboard_admin runbot.model_runbot_dashboard runbot.group_runbot_admin 1 1 1 1
37 access_runbot_dashboard_user runbot_dashboard_user runbot.model_runbot_dashboard group_user 1 0 0 0

View File

@ -110,12 +110,12 @@
<field name="name">runbot.build.error.tree</field>
<field name="model">runbot.build.error</field>
<field name="arch" type="xml">
<tree string="Errors">
<field name="module_name"/>
<field name="summary"/>
<tree string="Errors" decoration-danger="test_tags" multi_edit="1">
<field name="module_name" readonly="1"/>
<field name="summary" readonly="1"/>
<field name="random" string="Random"/>
<field name="last_seen_date" string="Last Seen"/>
<field name="build_count"/>
<field name="last_seen_date" string="Last Seen" readonly="1"/>
<field name="build_count" readonly="1"/>
<field name="responsible"/>
<field name="team_id"/>
<field name="test_tags"/>
@ -234,5 +234,34 @@
<field name="binding_view_types">form,list</field>
</record>
<record model="ir.ui.view" id="runbot_error_reassign_wizard_form">
<field name="name">runbot_error_reassign_wizard</field>
<field name="model">runbot.error.reassign.wizard</field>
<field name="arch" type="xml">
<form>
<sheet>
<group name="team_group">
<field name="team_id"/>
<field name="responsible_id"/>
</group>
<footer>
<button string="Submit" name="submit" type="object" class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</sheet>
</form>
</field>
</record>
<record id="runbot_open_reassign_wizard" model="ir.actions.act_window">
<field name="name">Reassign to another Team and/or User</field>
<field name="res_model">runbot.error.reassign.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="view_id" ref="runbot_error_reassign_wizard_form"/>
<field name="binding_model_id" ref="runbot.model_runbot_build_error"/>
<field name="binding_view_types">list</field>
</record>
</data>
</odoo>