diff options
| author | Thibault Delavallée <tde@openerp.com> | 2012-11-13 16:33:53 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2012-11-13 16:33:53 +0100 |
| commit | f736edb150a2a20cc1cfa36f8013a2945bc90950 (patch) | |
| tree | f6b6edf1d799a627213d0961a6c2f6b8ad89acce | |
| parent | 866956daa697f95218e9e91f9a0f4ca7bf8043ec (diff) | |
| parent | 183bc922c19a961d2a9202508fc5e756aee35c08 (diff) | |
[MERGE] Fix a bug related to Chatter when switching records in form view:
- when simply switching, old messages were concatenated
- when deleting a record, a crash occured
bzr revid: tde@openerp.com-20121113153353-jrl2hguv01oupam5
| -rw-r--r-- | addons/mail/static/src/js/mail.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index e214168cb25..d981420db51 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -1530,7 +1530,6 @@ openerp.mail = function (session) { 'display_indented_thread': -1, 'show_reply_button': false, 'show_read_unread_button': false, - 'show_compose_message': this.view.is_action_enabled('edit'), 'show_compact_message': 1, }, this.node.params); @@ -1556,9 +1555,10 @@ openerp.mail = function (session) { return; } - this.node.params = _.extend({ - 'message_ids': this.getParent().fields.message_ids ? this.getParent().fields.message_ids.get_value() : undefined, - }, this.node.params); + this.node.params = _.extend(this.node.params, { + 'message_ids': this.get_value(), + 'show_compose_message': this.view.is_action_enabled('edit'), + }); this.node.context = { 'default_res_id': this.view.datarecord.id || false, 'default_model': this.view.model || false, @@ -1571,7 +1571,6 @@ openerp.mail = function (session) { // create and render Thread widget this.root = new mail.Widget(this, _.extend(this.node, { 'domain' : (this.domain || []).concat([['model', '=', this.view.model], ['res_id', '=', this.view.datarecord.id]]), - })); return this.root.replace(this.$('.oe_mail-placeholder')); |
