Odoo Help

Welcome!

This community 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.

0

creating record does not work wich create() Metohdo or raw SQL

By
Jack
on 10/24/16, 9:21 AM 138 views

we try to save all generated pdf Reports by deriving from report Class and overwriting get_pdf:

class ReportDerived(models.Model):
_inherit = 'report'
@api.v7
def get_pdf(self, cr, uid, ids, report_name, html=None, data=None, context=None):
return super(ReportDerived, self).get_pdf(cr, uid, ids, report_name, html, data, context)

Model for storing:

class x_report_storage(models.TransientModel):
_name = "x_report.storage"
_description = "Storage of Reports"
model = fields.Text(string='Model:', required=False)
ids = fields.Text(string='IDs:', required=False)
filename = fields.Text(string='Filename:', required=False)



now we tried within the get_pdf Method different ways to store the data:

vals = {'model': 'test',            
'filename': 'testfname',
'ids': 'testIDS',}
self.env['x_report.storage'].create(vals)

or

ql = ('insert into x_report_storage(ids) values("aaa")')        
self.env.cr.execute(sql)

But both versions do not work.

We do not get any odoo-log entries. Odoo stops at this lines without any special response.

Please give some hints whats wrong.




Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/24/16, 9:21 AM
Seen: 138 times
Last updated: 10/24/16, 9:25 AM