I have a report which is printed from wizard and i need to send this report as an email attachment in odoo12.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
Hi Haresh,
Thanks for your valuable response. I tried this method but show some error. Already i have python file for the report, then using report_template showing data['id'] error
Python file
@api.model
def _get_report_values(self, docids, data=None):
report_obj = self.env['ir.actions.report']
reports = report_obj._get_report_from_name('module_name.report_name')
docs = self.env['payment.receipt.wiz'].browse(data['id'])
return {
'doc_ids': docids,
'doc_model': reports.model,
'docs': docs,
'data': data,
'get_report_record': self.get_report_record}
In Xml
<t t-set="value1" t-value="get_report_record(data)"/>
Wizard
return self.env.ref('module_name.report_id').report_action(self,data=self.read([])[0])
If any solution please help.
Thanks & Regards
Anju M.P
Hi Anju,
There is a option in email to attach report as attachment.
You can set report as attachment in email template. There is a field named as "report_template" in email template you can attach any report so whenever you send email then it will automatically attach report for specific model record
I hope it will very helpful for you
Thanks and regards
Haresh Kansara
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden