[IMP] mail.thread: removed test method, updated widget.
bzr revid: tde@openerp.com-20120403130831-f0stpw6zr1y7rguf
This commit is contained in:
parent
bfa67dc9d0
commit
89c6ac0ea7
|
@ -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':
|
||||
|
|
|
@ -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));
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue