[TMP] Added temp message_add_note method, that will replace message_append_note to eliminate redundancy in subjects through the addons.

bzr revid: tde@openerp.com-20120402134436-a6kgx7xvg2i0g8f1
This commit is contained in:
Thibault Delavallée
2012-04-02 15:44:36 +02:00
parent 6a56c8e8e1
commit 995b99698d
2 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -659,7 +659,12 @@ class mail_thread(osv.osv):
self.message_append_note(cr, uid, [id], message, context=context)
# tmp stuff
def message_add_note(self, cr, uid, ids, body, subject=_('System notification'), subtype='html', parent_id=False, type='notification', context=None):
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, body, parent_id=False, type='notification', context=None):
+2 -2
View File
@@ -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_append_note', [[this.params.res_id], 'Reply comment', body_text, this.params.parent_id, 'comment']).then(
return this.ds.call('message_add_note', [[this.params.res_id], body_text, 'comment', this.params.parent_id]).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_append_note', [[this.session.uid], 'Tweet', body_text, false, 'comment']).then(
return this.ds_users.call('message_add_note', [[this.session.uid], body_text, 'comment', false, 'Tweet', 'html']).then(
this.init_and_fetch_comments(this.params.limit, 0));
},
});