Odoo Help


how to generate single report for all manufacturing orders?

Hammad H Qureshi
on 3/4/15, 10:19 AM 589 views

I want to send daily manufacturing orders details to the manager via email. I had tried to acheive this by using email templates, it only generating report for only one manufacturing. Any good approach for this? 

Hammad H Qureshi
On 3/16/15, 5:22 AM

I have acheived it by attaching custom report consisting of all MOs with the email template 


 if matching_reports:
            report = ir_actions_report.browse(cr, uid, matching_reports[0])
            report_service = 'report.' + report.report_name
            service = netsvc.LocalService(report_service)
            (result, format) = service.create(cr, uid, mrp_ids, {'model': self._name}, context=context)
#             eval_context = {'time': time, 'object': self.pool.get('mrp.production')}

        if not report.attachment: # or not eval(report.attachment, eval_context)
            file_name = "dailyreport" #re.sub(r'[^a-zA-Z0-9_-]', '_', 'dailyreport')
            file_name += ".pdf"
            attachment_id = attachment_obj.create(cr, uid,
                                                   'name': file_name,
                                                   'datas': result,
                                                   'datas_fname': file_name,
#                                                    'res_model': 'email.template',
#                                                    'res_id': email.id,
                                                   'type': 'binary'
                                                   }, context=context)
        email_obj.write(cr, uid, template_id, {'email_from': email.email_from, 
                                               'email_to': email.email_to, 
                                               'subject': email.subject,
                                               'email_recipients': email.email_recipients,
                                               'attachment_ids' : [(6,0, [attachment_id])],

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/4/15, 10:19 AM
Seen: 589 times
Last updated: 3/28/15, 7:42 AM