Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Email tracking

Entity: mail.message

Compute Method: _compute_is_failed_message

View 18.0
Inputs Method Outputs
  • mail_tracking_needs_action
  • author_id
  • notification_ids
  • notification_ids.res_partner_id
+ """Compute 'is_failed_message' field for the active user"""
+ failed_states = self.get_failed_states()
+ for message in self:
+             needs_action = message.mail_tracking_needs_action
+             involves_me = self.env.user.partner_id in (
+                 message.author_id | message.notification_ids.res_partner_id
+             )
+             has_failed_trackings = failed_states.intersection(
+                 message.mapped("mail_tracking_ids.state")
+             )
+             message.is_failed_message = bool(
+                 needs_action and involves_me and has_failed_trackings
+             )
  • is_failed_message

Back to entity