Browse Source

Add message sent to objects chatter.

pull/279/head
Peter Hahn 9 years ago
parent
commit
7b0162847f
  1. 3
      web_widget_mail_send_odoo/README.rst
  2. 28
      web_widget_mail_send_odoo/static/src/js/web_widget_mail_send_odoo.js

3
web_widget_mail_send_odoo/README.rst

@ -10,6 +10,9 @@ This module was written to provide a new widget for Email fields to replace the
standard behaviour of displaying a 'mailto:' link with JS to open the internal standard behaviour of displaying a 'mailto:' link with JS to open the internal
Email wizard from Odoo for message composition. Email wizard from Odoo for message composition.
The message you sent gets appended to the chatter as if you where using internal
mail functions of Odoo.
Usage Usage
===== =====

28
web_widget_mail_send_odoo/static/src/js/web_widget_mail_send_odoo.js

@ -41,18 +41,19 @@ instance.web.form.FieldEmailIntern = instance.web.form.FieldChar.extend({
if(partner){ if(partner){
var fm = self.field_manager var fm = self.field_manager
self.do_action( self.do_action(
'mail.action_email_compose_message_wizard',{
additional_context:{
default_partner_ids: [partner.id],
default_composition_mode: 'comment',
/* write to active model:
I think we do not want't this on res.partner?
Make this configurable?
default_model: fm.dataset._model.name,
default_res_id: fm.datarecord.id,
*/
}}
'mail.action_email_compose_message_wizard', {
additional_context: {
default_partner_ids: [partner.id],
default_composition_mode: 'comment',
// write to active model:
default_model: fm.dataset._model.name,
default_res_id: fm.datarecord.id,
},
on_close: function(){
/* Todo: refresh the chatter widget here
*/
},
}
) )
} else { } else {
self.do_warn(_t("E-mail Error"), self.do_warn(_t("E-mail Error"),
@ -65,9 +66,6 @@ instance.web.form.FieldEmailIntern = instance.web.form.FieldChar.extend({
}, },
}); });
// Todo: Do not replace the default widget by default, make this configurable
// or put in an extra module
instance.web.form.widgets.add('email', 'instance.web.form.FieldEmailIntern') instance.web.form.widgets.add('email', 'instance.web.form.FieldEmailIntern')
//instance.web.form.widgets.add('email-intern', 'instance.web.form.FieldEmailIntern')
})() })()
Loading…
Cancel
Save