跳至內容
選單
此問題已被標幟
2 回覆
12460 瀏覽次數

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'
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
9月 23
20377
1
3月 21
4437
0
5月 17
2180
0
5月 22
1724
1
4月 22
8841