Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
13136 Zobrazení

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

Error is 

Error Preview

Code is 

Code Preview

Avatar
Zrušit
Nejlepší odpověď

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!

Avatar
Zrušit
Nejlepší odpověď

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'
Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
zář 23
21261
1
bře 21
5063
0
kvě 17
2583
0
kvě 22
2364
1
dub 22
9579