[IMP] runbot: add a display field to show error id in content tree

This commit is contained in:
Christophe Monniez 2024-11-13 13:46:34 +01:00
parent b95256155c
commit dc7eb66903
2 changed files with 7 additions and 0 deletions

View File

@ -326,6 +326,7 @@ class BuildErrorContent(models.Model):
_rec_name = "id"
error_id = fields.Many2one('runbot.build.error', 'Linked to', index=True, required=True)
error_display_id = fields.Integer(compute='_compute_error_display_id', string="Error id")
content = fields.Text('Error message', required=True)
cleaned_content = fields.Text('Cleaned error message')
summary = fields.Char('Content summary', compute='_compute_summary', store=False)
@ -424,6 +425,11 @@ class BuildErrorContent(models.Model):
for build_error in self:
build_error.summary = build_error.content[:80]
@api.depends('error_id')
def _compute_error_display_id(self):
for error_content in self:
error_content.error_display_id = error_content.error_id.id
@api.model
def _digest(self, s):
"""

View File

@ -243,6 +243,7 @@
<header>
<button name="%(runbot.runbot_open_bulk_wizard)d" string="Bulk Update" type="action" groups="runbot.group_runbot_admin,runbot.group_runbot_error_manager"/>
</header>
<field name="error_display_id" optional="show"/>
<field name="module_name" optional="show" readonly="1"/>
<field name="summary" optional="show" readonly="1"/>
<field name="random" string="Random"/>