mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
Add message sent to objects chatter.
This commit is contained in:
@@ -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
|
||||
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
|
||||
=====
|
||||
|
||||
|
||||
@@ -41,18 +41,19 @@ instance.web.form.FieldEmailIntern = instance.web.form.FieldChar.extend({
|
||||
if(partner){
|
||||
var fm = self.field_manager
|
||||
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 {
|
||||
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-intern', 'instance.web.form.FieldEmailIntern')
|
||||
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user