diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 2965d4dad7a..9f76813eac2 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -742,7 +742,9 @@ class MailThread(models.AbstractModel): access_link = self._notify_get_action_link('view') if message.model: - model_name = self.env['ir.model']._get(message.model).display_name + model = self.env['ir.model'].with_context( + lang=self.env.context.get('lang', self.env.user.lang)) + model_name = model._get(message.model).display_name view_title = _('View %s') % model_name else: view_title = _('View') diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py index f96a9f0f974..2d45899f142 100644 --- a/addons/test_mail/tests/test_performance.py +++ b/addons/test_mail/tests/test_performance.py @@ -265,7 +265,7 @@ class TestAdvMailPerformance(TransactionCase): def test_message_post_one_email_notification(self): record = self.env['mail.test.simple'].create({'name': 'Test'}) - with self.assertQueryCount(__system__=51, emp=71): # com runbot: 51 - 71 // test_mail only: 48 - 68 + with self.assertQueryCount(__system__=52, emp=72): # com runbot: 52 - 72 // test_mail only: 48 - 68 record.message_post( body='
Test Post Performances with an email ping
', partner_ids=self.customer.ids,