diff --git a/mail_move_message/mail_move_message_models.py b/mail_move_message/mail_move_message_models.py index 797b11a..565e62d 100644 --- a/mail_move_message/mail_move_message_models.py +++ b/mail_move_message/mail_move_message_models.py @@ -320,6 +320,10 @@ class mail_message(models.Model): 'model': vals.get('model'), 'is_moved': vals['is_moved'] } + if vals.get('model') and vals.get('res_id'): + record = self.env[vals.get('model')].browse(vals.get('res_id')) + if record: + notification['record_name'] = record.name self.env['bus.bus'].sendone((self._cr.dbname, 'mail_move_message'), notification) def name_get(self, cr, uid, ids, context=None): diff --git a/mail_move_message/static/src/js/mail_move_message.js b/mail_move_message/static/src/js/mail_move_message.js index 85869e8..f8fca02 100644 --- a/mail_move_message/static/src/js/mail_move_message.js +++ b/mail_move_message/static/src/js/mail_move_message.js @@ -77,6 +77,7 @@ odoo.define('mail_move_message.relocate', function (require) { if (model === 'mail_move_message' && message) { message.res_id = notification[1].res_id; message.model = notification[1].model; + message.record_name = notification[1].record_name; // Mark message as moved after move message.is_moved = notification[1].is_moved; // Update cache and accordingly message in the thread