summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_message.py
diff options
context:
space:
mode:
authorFlorent de Labarre <florent.mirieu@gmail.com>2021-05-11 14:26:33 +0000
committerFlorent de Labarre <florent.mirieu@gmail.com>2021-05-11 14:26:33 +0000
commit9dcecc0e46ac66edac4636d26c18e8a249b3c7de (patch)
tree7428be820371217e57981c7bcbdef4bf1b4f0ad4 /addons/mail/models/mail_message.py
parentc347f679d6a635428b12ffa04b5e16b4f2d3d78f (diff)
[FIX] mail: impossible to update image of partner on large database
On large database with million of messages made by one partner. When you try to update the image of partner, it take lot of time (CPU time limit).
Diffstat (limited to 'addons/mail/models/mail_message.py')
-rw-r--r--addons/mail/models/mail_message.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index 8496a57958e..45356755259 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -80,7 +80,7 @@ class Message(models.Model):
author_id = fields.Many2one(
'res.partner', 'Author', index=True, ondelete='set null',
help="Author of the message. If not set, email_from may hold an email address that did not match any partner.")
- author_avatar = fields.Binary("Author's avatar", related='author_id.image_128', readonly=False)
+ author_avatar = fields.Binary("Author's avatar", related='author_id.image_128', depends=['author_id'], readonly=False)
# recipients: include inactive partners (they may have been archived after
# the message was sent, but they should remain visible in the relation)
partner_ids = fields.Many2many('res.partner', string='Recipients', context={'active_test': False})