Skip to content

Commit 6beede9

Browse files
committed
[IMP] runbot: add a display field to show error id in content tree
1 parent a3cfa3a commit 6beede9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

runbot/models/build_error.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ class BuildErrorContent(models.Model):
326326
_rec_name = "id"
327327

328328
error_id = fields.Many2one('runbot.build.error', 'Linked to', index=True, required=True)
329+
error_display_id = fields.Integer(compute='_compute_error_display_id', string="Error id")
329330
content = fields.Text('Error message', required=True)
330331
cleaned_content = fields.Text('Cleaned error message')
331332
summary = fields.Char('Content summary', compute='_compute_summary', store=False)
@@ -424,6 +425,11 @@ def _compute_summary(self):
424425
for build_error in self:
425426
build_error.summary = build_error.content[:80]
426427

428+
@api.depends('error_id')
429+
def _compute_error_display_id(self):
430+
for error_content in self:
431+
error_content.error_display_id = error_content.error_id.id
432+
427433
@api.model
428434
def _digest(self, s):
429435
"""

runbot/views/build_error_views.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243
<header>
244244
<button name="%(runbot.runbot_open_bulk_wizard)d" string="Bulk Update" type="action" groups="runbot.group_runbot_admin,runbot.group_runbot_error_manager"/>
245245
</header>
246+
<field name="error_display_id" optional="show"/>
246247
<field name="module_name" optional="show" readonly="1"/>
247248
<field name="summary" optional="show" readonly="1"/>
248249
<field name="random" string="Random"/>

0 commit comments

Comments
 (0)