mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[FIX] base_exception_user: fix stack trace when exception description is False
H7674
This commit is contained in:
committed by
Salomon Chambi
parent
03bef328ab
commit
a8709fc316
@@ -1,7 +1,26 @@
|
||||
from odoo import models, fields
|
||||
import html
|
||||
from odoo import api, models, fields
|
||||
|
||||
|
||||
class ExceptionRule(models.Model):
|
||||
_inherit = 'exception.rule'
|
||||
|
||||
allow_user_ignore = fields.Boolean('Allow User Ignore')
|
||||
|
||||
|
||||
class BaseException(models.AbstractModel):
|
||||
_inherit = 'base.exception'
|
||||
|
||||
@api.depends("exception_ids", "ignore_exception")
|
||||
def _compute_exceptions_summary(self):
|
||||
for rec in self:
|
||||
if rec.exception_ids and not rec.ignore_exception:
|
||||
rec.exceptions_summary = "<ul>%s</ul>" % "".join(
|
||||
[
|
||||
"<li>%s: <i>%s</i></li>"
|
||||
% tuple(map(html.escape, (e.name, e.description or '')))
|
||||
for e in rec.exception_ids
|
||||
]
|
||||
)
|
||||
else:
|
||||
rec.exceptions_summary = False
|
||||
|
||||
Reference in New Issue
Block a user