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

Hi,
I'm trying to pass both docids and data to the qweb report but realise that I can only pass docids or data. In my search for this issue, I found exactly the same issue as my problem but closed.

Error when using data parameter in report_action function 

@pedrobaeza said:

I would say that using both arguments (docids and data) is not something supported. 

Why not? And how can I do this in another way?

Thanks!

อวตาร
ละทิ้ง
ผู้เขียน

Hi everyone, any solutions?

คำตอบที่ดีที่สุด

Hi

Try the following code,

from odoo import models,api
class VehicleReport(models.AbstractModel):
    _name = 'report.vehicle.report_vehicle_order’
 
    @api.model
    def _get_report_values(self, docids, data=None):
        docs = self.env[model.model].browse(docids)
        return {
              'doc_ids': docids,
              'doc_model': model.model,
              'docs': docs,
              'data': data,
        }


For more reference, you can refer to the blog : https://www.cybrosys.com/blog/how-to-create-a-custom-pdf-report-in-odoo-16

Hope it helps

อวตาร
ละทิ้ง
ผู้เขียน

Hi,
Thank you for your answer, but it's not working.

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ส.ค. 25
2608
1
พ.ค. 25
2639
1
เม.ย. 25
3627
1
เม.ย. 25
4490
1
เม.ย. 25
1961