Skip to content
Permalink
Browse files

[FIX] mail: computed fields on new records

  • Loading branch information...
rco-odoo committed May 15, 2019
1 parent ad66461 commit 25c12eff349d979afd5a23be86c85a05a3c0bcf2
Showing with 3 additions and 3 deletions.
  1. +3 −3 addons/mail/models/mail_thread.py
@@ -194,7 +194,7 @@ def _get_message_unread(self):
res[result[0]] += 1

for record in self:
record.message_unread_counter = res.get(record.id, 0)
record.message_unread_counter = res.get(record._origin.id, 0)
record.message_unread = bool(record.message_unread_counter)

@api.multi
@@ -211,7 +211,7 @@ def _get_message_needaction(self):
res[result[0]] += 1

for record in self:
record.message_needaction_counter = res.get(record.id, 0)
record.message_needaction_counter = res.get(record._origin.id, 0)
record.message_needaction = bool(record.message_needaction_counter)

@api.model
@@ -231,7 +231,7 @@ def _compute_message_has_error(self):
res.update(self._cr.fetchall())

for record in self:
record.message_has_error_counter = res.get(record.id, 0)
record.message_has_error_counter = res.get(record._origin.id, 0)
record.message_has_error = bool(record.message_has_error_counter)

@api.model

0 comments on commit 25c12ef

Please sign in to comment.
You can’t perform that action at this time.