Skip to content

Commit

Permalink
[IMP] runbot: add a display field to show error id in content tree
Browse files Browse the repository at this point in the history
  • Loading branch information
d-fence committed Nov 14, 2024
1 parent b952561 commit dc7eb66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runbot/models/build_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -424,6 +425,11 @@ def _compute_summary(self):
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):
"""
Expand Down
1 change: 1 addition & 0 deletions runbot/views/build_error_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down

0 comments on commit dc7eb66

Please sign in to comment.