From 89c6ac0ea7c7e5469c8f468eb8daaa60a4a7e38f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 3 Apr 2012 15:08:31 +0200 Subject: [PATCH] [IMP] mail.thread: removed test method, updated widget. bzr revid: tde@openerp.com-20120403130831-f0stpw6zr1y7rguf --- addons/mail/mail_thread.py | 10 +--------- addons/mail/static/src/js/mail.js | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 03045eda15b..dbbf3dad522 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -401,6 +401,7 @@ class mail_thread(osv.osv): arg[0] = 'message_id.' + arg[0] # compose final domain domain = [('user_id', '=', uid)] + notif_search_domain + msg_search_domain + #print domain # get notifications notification_ids = notification_obj.search(cr, uid, domain, limit=limit, offset=offset, context=context) notifications = notification_obj.browse(cr, uid, notification_ids, context=context) @@ -658,15 +659,6 @@ class mail_thread(osv.osv): _logger.warning("log() is deprecated. Please use OpenChatter notification system instead of the res.log mechanism.") self.message_append_note(cr, uid, [id], 'res.log', message, context=context) - # tmp stuff - def message_add_note(self, cr, uid, ids, body, type='notification', parent_id=False, subject=False, subtype='html', context=None): - if not subject: - if type == 'notification': - subject = _('System notification on %s') % (self._name, fields.datetime.now()) - elif type == 'comment': - subject = _('Reply on %s at %s') % (self._name, fields.datetime.now()) - return self.message_append(cr, uid, ids, subject, body_text=body, parent_id=parent_id, type=type, context=context) - def message_append_note(self, cr, uid, ids, subject=None, body=None, parent_id=False, type='notification', subtype='html', context=None): if subject is None: if type == 'notification': diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index c736eadd85e..b10ccbec203 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -296,7 +296,7 @@ openerp.mail = function(session) { var comment_node = this.$element.find('textarea'); var body_text = comment_node.val(); comment_node.val(''); - return this.ds.call('message_add_note', [[this.params.res_id], body_text, 'comment', this.params.parent_id]).then( + return this.ds.call('message_append_note', [[this.params.res_id], 'Reply', body_text, this.params.parent_id, 'comment']).then( this.proxy('init_comments')); }, @@ -804,7 +804,7 @@ openerp.mail = function(session) { /** Action: Posts a comment */ do_comment: function () { var body_text = this.$element.find('textarea.oe_mail_wall_action_textarea').val(); - return this.ds_users.call('message_add_note', [[this.session.uid], body_text, 'comment', false, 'Tweet', 'html']).then( + return this.ds_users.call('message_append_note', [[this.session.uid], 'Tweet', body_text, false, 'comment', 'html']).then( this.init_and_fetch_comments(this.params.limit, 0)); }, });