mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot: add a close error wizard
When marking multiple build error as fixed, it's sometimes necessary to explain why it was decided to close the error. When working with a few errors, this can be done manually ... But most of the time we want to close a lot of false negatives in batch. With this commit, a simple wizard is made available that will post a reason in the chatter of the build_errors.
This commit is contained in:
parent
1e8e059734
commit
3a9832d747
@ -247,3 +247,17 @@ class ErrorRegex(models.Model):
|
||||
if re.search(filter.regex, s):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class ErrorClosingWizard(models.TransientModel):
|
||||
_name = 'runbot.error.closing.wizard'
|
||||
_description = "Errors Closing Wizard"
|
||||
|
||||
reason = fields.Char("Closing Reason", help="Reason that will appear in the chatter")
|
||||
|
||||
def submit(self):
|
||||
error_ids = self.env['runbot.build.error'].browse(self.env.context.get('active_ids'))
|
||||
if error_ids:
|
||||
for build_error in error_ids:
|
||||
build_error.message_post(body=self.reason, subject="Closing Error")
|
||||
error_ids['active'] = False
|
||||
|
@ -28,6 +28,8 @@ access_runbot_build_error_tag_manager,runbot_build_error_tag_manager,runbot.mode
|
||||
access_runbot_team_admin,runbot_team_admin,runbot.model_runbot_team,runbot.group_runbot_admin,1,1,1,1
|
||||
access_runbot_team_team_manager,runbot_team_team_manager,runbot.model_runbot_team,runbot.group_runbot_team_manager,1,1,1,1
|
||||
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_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
|
||||
|
|
@ -204,5 +204,33 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="runbot_error_closing_wizard_form">
|
||||
<field name="name">runbot_error_closing_wizard</field>
|
||||
<field name="model">runbot.error.closing.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group name="closing_group">
|
||||
<field name="reason"/>
|
||||
</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_error_closing_wizard" model="ir.actions.act_window">
|
||||
<field name="name">Close Errors With A Reason</field>
|
||||
<field name="res_model">runbot.error.closing.wizard</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="view_id" ref="runbot_error_closing_wizard_form"/>
|
||||
<field name="binding_model_id" ref="runbot.model_runbot_build_error"/>
|
||||
<field name="binding_view_types">form,list</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
Loading…
Reference in New Issue
Block a user