From c5615609e5e7c32105af637176dc6ad40b928e76 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 10 Oct 2012 13:02:03 +0200 Subject: [PATCH] [IMP]mail : field reload with wizard mail bzr revid: chm@openerp.com-20121010110203-bs42eg6ie7m79bf3 --- addons/mail/static/src/js/mail.js | 83 +++++++++++++++---------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 08ae0197958..d2f2358af5f 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -20,35 +20,28 @@ openerp.mail = function(session) { do_action: function(action, on_close) { if (action.res_model == 'mail.compose.message') { - if(action.action_from != 'mail.ThreadComposeMessage' && action.type != 'ir.actions.act_window_close'){ - // destroy wall before reload - $('.openerp .oe_mail_wall_threads .oe_mail_thread button.oe_mail_wall_button_destroy').click(); + /* hack for stop context propagation of wrong value + * delete this hack when a global method to clean context is create + */ + for(var key in action.context){ + if( key!='default_template_id' && + key!='default_use_template' && + key!='default_is_private' && + key!='default_model' && + key!='default_res_id' && + key!='default_subtype' && + key!='active_id' && + key!='lang' && + key!='bin_raw' && + key!='tz' && + key!='active_model' && + key!='edi_web_url_view' && + key!='active_ids') + action.context[key]=null; + }; + /* end hack */ - - /* hack for stop context propagation of wrong value - * delete this hack when a global method to clean context is create - */ - for(var key in action.context){ - if( key!='default_template_id' && - key!='default_use_template' && - key!='default_model' && - key!='default_res_id' && - key!='default_subtype' && - key!='active_id' && - key!='lang' && - key!='bin_raw' && - key!='tz' && - key!='active_model' && - key!='edi_web_url_view' && - key!='active_ids') - action.context[key]=null; - }; - /* end hack */ - - - } else { - $('.openerp .oe_mail_wall_threads .oe_mail_thread button.oe_mail_wall_button_fletch').click(); - } + $('.openerp .oe_mail_wall_threads .oe_mail_thread button.oe_mail_wall_button_fetch').click(); } return this._super(action, on_close); @@ -370,7 +363,7 @@ openerp.mail = function(session) { } }, - /*post a message and fletch the message*/ + /*post a message and fetch the message*/ on_message_post: function (body) { if (! body) { @@ -459,7 +452,7 @@ openerp.mail = function(session) { */ on_expandable: function (event) { if(event)event.stopPropagation(); - this.parent_thread.message_fletch(false, this.domain, this.context); + this.parent_thread.message_fetch(false, this.domain, this.context); this.destroy(); return false; }, @@ -495,7 +488,7 @@ openerp.mail = function(session) { * @param {Object} [options] * @param {Object} [thread] read obout mail.Thread object * @param {Object} [message] - * @param {Number} [message_ids=null] ids for message_fletch + * @param {Number} [message_ids=null] ids for message_fetch * @param {Number} [message_data=null] already formatted message data, * for subthreads getting data from their parent * @param {Number} [truncate_limit=250] number of character to @@ -804,7 +797,7 @@ openerp.mail = function(session) { * @param {Boolean} [display_on_flat] display all thread * on the wall thread level (no hierarchy) * @param {Array} [parents] liked with the parents thread - * use with browse, fletch... [O]= top parent + * use with browse, fetch... [O]= top parent */ init: function(parent, options) { this._super(parent); @@ -888,7 +881,7 @@ openerp.mail = function(session) { on_first_thread: function(){ var self=this; // fetch and display message, using message_ids if set - this.message_fletch(); + this.message_fetch(); $(document).scroll( self.on_scroll ); window.setTimeout( self.on_scroll, 500 ); @@ -900,15 +893,11 @@ openerp.mail = function(session) { this.ComposeMessage.set_free_attachments(); } - var button_destroy = $('