diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index f56da844e06..bc2fe238fee 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -114,6 +114,7 @@ class mail_message(osv.Model): 'message_id': fields.char('Message-Id', size=256, help='Message unique identifier', select=1, readonly=1), 'body': fields.html('Content', required=True), } + def _get_default_author(self, cr, uid, context={}): return self.pool.get('res.users').browse(cr, uid, uid, context=context).partner_id.id diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 61f0992171c..706a744b20f 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -376,7 +376,6 @@ openerp.mail = function(session) { console.groupCollapsed('New Thread: model', this.options.context.res_model, 'id', this.options.context.res_id, 'parent_id', this.options.context.parent_id, 'thread level', this.options.thread_level); console.log('records:', this.options.records, 'ids:', this.options.ids); console.log('options:', this.options); - console.log('options:', options); console.log('display:', this.display); console.groupEnd(); }, @@ -519,73 +518,23 @@ openerp.mail = function(session) { var read_defer = this.ds_msg.call('message_read', [false, fetch_domain, this.options.thread_level, fetch_context] ).then(this.proxy('message_display')); - // function (records) { - // if (records.length <= self.options.limit) self.display.show_more = false; - // else { self.display.show_more = true; records.pop(); } - // else { self.display.show_more = true; records.splice(0, 1); } - // else { self.display.show_more = true; } - // self.display_comments(records); - // TODO: move to customize display - // if (self.display.show_more == true) self.$element.find('div.oe_mail_thread_more:last').show(); - // else self.$element.find('div.oe_mail_thread_more:last').hide(); - // }); return read_defer; }, - /* TDE: not necessary as we can read on ids or false */ - // display_comments_from_parameters: function (records) { - // if (records.length > 0 && records.length < (records[0].child_ids.length+1) ) this.display.show_more = true; - // else this.display.show_more = false; - // var defer = this.display_comments(records); - // // TODO: move to customize display - // if (this.display.show_more == true) $('div.oe_mail_thread_more').eq(-2).show(); - // else $('div.oe_mail_thread_more').eq(-2).hide(); - // return defer; - // }, - - /** Display comments - * @param {Array} records tree structure of records - */ - // display_comments: function (records) { - // console.log(records); - // // debugger - // var self = this; - // var _expendable = false; - // _(records).each(function (root_record) { - // /* expandable type: add a 'Show more button' */ - // if (root_record.type == 'expandable') { - // _expendable = true; - // self.update_fetch_more(true); - // self.fetch_more_domain = root_record.domain; - // self.fetch_more_context = root_record.context; - // } - // // display classic root record - // else { - // var render_res = session.web.qweb.render('mail.wall_thread_container', {}); - // $('