Odoo Help

0

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

By
Jack
on 10/24/16, 9:21 AM 220 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.




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.

Register

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)

Stats

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