Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2444 Lượt xem

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.




Ảnh đại diện
Huỷ bỏ