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

Hi, 

I am trying to show odoo 14 rpeort in HTML field. I was using following code for showing report in odoo 10:

 @api.multi

 def generate_preview(self,id):

data = self.id

html = self.env['report'].get_html(self, 'sale_order_form_report.report_form_view',data=data)

self.write({'report': html})

return True

Noe its not working in odoo 14 due to following function:

AttributeError: 'ir.actions.report' object has no attribute 'get_html'

I have used help from the following \this link . But still showing following error

AttributeError: 'ir.actions.report' object has no attribute 'render_qweb_html'

Now what will be the best/optimal way to show a qweb report in html field in odoo 14.



الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Thats the right way to get data in odoo 14, rest all the procedure same as odoo 10

data, data_format = self.env.ref('account.account_invoices_without_payment')\ .sudo()._render_qweb_pdf([self.id])

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Please refer this link

https://www.odoo.com/forum/help-1/how-can-i-preview-the-attchement-like-pdf-docs-in-a-browser-from-my-custom-model-153331


Thanks

Muhammed Ali M - iWesabe

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
فبراير 22
2849
1
يناير 24
656
2
أكتوبر 18
28024
1
مارس 25
1925
5
أكتوبر 24
31047