odoomrp / odoomrp-wip

WIP of OdooMRP
http://www.odoomrp.com
GNU Affero General Public License v3.0
117 stars 247 forks source link

psycopg2.ProgrammingError: can't adapt type 'event.model' #1418

Open heniq opened 6 years ago

heniq commented 6 years ago

Error to render compiling AST ProgrammingError: can't adapt type 'event.model' Template: event_management.report_event_booking_template_document Path: /templates/t/div[2]/div/div[2]/div/table[1]/thead/tr/th[2]/span Node:

i cant pass data in render_qweb_pdf(self,data=data),here is my code

report_name = 'event_management.report_event_booking_template' report_data = {'form': self.read()[0], 'ids': self.id, 'model': 'event.model'} xml_id = self.env['ir.actions.report'].search([('report_name','=',report_name)]) pdf_data = xml_id.render_qweb_pdf(self,data=report_data) ) data = base64.encodestring(pdf_data[0]) pdfvals = {'name': ("%s.pdf" % self.event_number), 'res_id': self.id, 'datas': data, 'datas_fname': ("%s.pdf" % self.event_number), 'type': 'binary', } pdf_create = self.env['ir.attachment'].create(pdfvals)