[FIX] mail.js: fixed some function names / mail_followers: fixed an email_to.
bzr revid: tde@openerp.com-20120821160036-jruwclg54d67a21y
This commit is contained in:
@@ -77,7 +77,7 @@ class mail_notification(osv.Model):
|
||||
msg = msg_obj.browse(cr, uid, msg_id, context=context)
|
||||
|
||||
towrite = {
|
||||
'email_to': '',
|
||||
'email_to': [],
|
||||
'subject': msg.subject
|
||||
}
|
||||
for partner in partner_obj.browse(cr, uid, partner_ids, context=context):
|
||||
@@ -92,16 +92,14 @@ class mail_notification(osv.Model):
|
||||
continue
|
||||
|
||||
towrite['state'] = 'outgoing'
|
||||
if not towrite.get('email_to', False):
|
||||
towrite['email_to'] = email_to
|
||||
else:
|
||||
if email_to not in towrite['email_to']:
|
||||
towrite['email_to'] = towrite['email_to'] + ', ' + email_to
|
||||
if partner.email not in towrite['email_to']:
|
||||
towrite['email_to'].append(partner.email)
|
||||
|
||||
if towrite.get('state', False) and not context.get('noemail', False):
|
||||
if towrite.get('subject', False):
|
||||
towrite['subject'] = msg.name_get(cr, uid, [msg.id], context=context)[0][1]
|
||||
towrite['message_id'] = msg.id
|
||||
towrite['email_to'] = ', '.join(towrite['email_to'])
|
||||
mail_message_obj = self.pool.get('mail.mail')
|
||||
newid = mail_message_obj.create(cr, uid, towrite, context=context)
|
||||
mail_message_obj.send(cr, uid, [newid], context=context)
|
||||
|
||||
@@ -358,7 +358,7 @@ openerp.mail = function(session) {
|
||||
this.$element.find('textarea.oe_mail_compose_textarea').keyup(function (event) {
|
||||
var charCode = (event.which) ? event.which : window.event.keyCode;
|
||||
if (event.shiftKey && charCode == 13) { this.value = this.value+"\n"; }
|
||||
else if (charCode == 13) { return self.do_message_post(); }
|
||||
else if (charCode == 13) { return self.message_post(); }
|
||||
});
|
||||
// event: click on 'Reply' in msg
|
||||
this.$element.on('click', 'a.oe_mail_msg_reply', function (event) {
|
||||
@@ -437,7 +437,7 @@ openerp.mail = function(session) {
|
||||
|
||||
/** Clean the thread */
|
||||
message_clean: function() {
|
||||
this.$el.find('div.oe_mail_thread_display').empty();
|
||||
this.$element.find('div.oe_mail_thread_display').empty();
|
||||
},
|
||||
|
||||
/** Fetch messages
|
||||
@@ -552,7 +552,7 @@ openerp.mail = function(session) {
|
||||
}
|
||||
return this.ds_post.call('message_post', [
|
||||
[this.options.context.res_id], body, false, 'comment', this.options.context.parent_id]
|
||||
).then(this.proxy('init_comments'));
|
||||
).then(this.proxy('message_fetch'));
|
||||
},
|
||||
|
||||
/** Action: 'shows more' to fetch new messages */
|
||||
|
||||
Reference in New Issue
Block a user