I want send invoice email from phyton code. I need Account Invoice, Send By Mail Button simulate or working code. i checked account.invoice.py and that code just create ctx and wizard form. i cant find clean code about this.
Anyone can tell me, how can i send invoice mail with default mail template easy way ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2
Replies
3916
Views
Hello,
Try Below code may be it's help you
template_id = self.env.ref('module_name.template_name')
if template_id:
self.env['mail.template'].sudo().browse(template_id.id).send_mail(self.id, force_send=True)
Thanks
Hi manish, thank your quick answer. I try your solution its worked, but i cant see email infos in invoice notes area? Also sent email without mail header footer.
i think your code wok similar test email template action.
or how can write email info to invoce notes similar send by mail button action?
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up