تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
12952 أدوات العرض

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
سبتمبر 23
21024
1
مارس 21
4875
0
مايو 17
2450
0
مايو 22
2156
1
أبريل 22
9391