Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
13099 มุมมอง

i'm converting Qweb Report from Odoo V12 to Odoo V10

Error is 

Error Preview

Code is 

Code Preview

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

In Odoo v10 use _get_report_from_name instead report_action.

e.g:

@api.model
def render_html(self, docids, data=None):
report_obj = self.env['report']
report = report_obj._get_report_from_name('de_partner_statement.partner_ledger_pdf')
docargs = {

'doc_ids': docids,
'doc_model': report.model,
'docs': self,
'result': {...}
}
return report_obj.render('de_partner_statement.partner_ledger_pdf', docargs)

Best regards!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I have the same problem. I am using odoo 13, but when I trying this solution give this error;

 report_type = self.report_type.lower().replace('-', '_')
AttributeError: 'bool' object has no attribute 'lower'
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ย. 23
21224
1
มี.ค. 21
5049
0
พ.ค. 17
2575
0
พ.ค. 22
2356
1
เม.ย. 22
9564