diff --git a/base_exception_user/models/base_exception.py b/base_exception_user/models/base_exception.py index 46453bce..6be0da0a 100644 --- a/base_exception_user/models/base_exception.py +++ b/base_exception_user/models/base_exception.py @@ -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 = "
Exceptions ignored:
' + exceptions_summary self.related_model_id.message_post(body=msg)