Browse Source

[FIX] Fix error when show task.project records haven't record_name

pull/36/head
x620 9 years ago
parent
commit
3821e12812
  1. 4
      mail_move_message/mail_move_message_models.py
  2. 1
      mail_move_message/static/src/js/mail_move_message.js

4
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):

1
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

Loading…
Cancel
Save