Hello
You have do code like..
XML: add button for send the mail
<button name="btn_send_mail" string="Send Mail" type="object"/>
Python:
@api.multi
def btn_send_mail(self):
template_id = self.env.ref('module_name.email_template_xml_id').id
compose_form_id = self.env.ref('mail.email_compose_message_wizard_form').id
ctx = {
'default_model': 'your_object',
'default_res_id': self.id,
'default_use_template': bool(template_id),
'default_template_id': template_id,
'default_composition_mode': 'comment',
'custom_layout': "mail.mail_notification_paynow",
'force_email': True
}
return {
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.compose.message',
'views': [(compose_form_id, 'form')],
'view_id': compose_form_id,
'target': 'new',
'context': ctx,
}
Send Email on button click: http://learnopenerp.blogspot.com/2017/08/odoo-how-to-send-email-on-button-click.html
Dear Sehrish I have tried this method, the email is sent automatically without popping out like that in sale.