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

Dear all,

Good morning.
I am working with Odoo 12 and need to force Odoo to print 2 reports when a user clicks on a specific button (ie.: Validate button on Payments).

What I have:

Action for Report 1:
    @api.multi
    def print_report1(self):
        return self.env.ref('mymodule.report_1').report_action(self, data=None)

Action for Report 2:
    @api.multi
    def print_report2(self):
        return self.env.ref('mymodule.report_2').report_action(self, data=None)

Action for the desired button to trigger the reports print
    @api.multi
    def action_confirm(self, vals):
        #several code goes here...

        print report1            ----> how to print report 1 here
        print report2            ----> how to print report 2 here

How can I force "action_confirm" to execute it's code and at the end print both report1 and report2?

I have tried to add:

    self.print_report1()
    self.print_report2()

...but it does not work.


Thank you all in advance

Best regards

PM

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Dear Paulo,

I have the same issue  now.  Have you found a solution for this?

Thanks,

Gabor

อวตาร
ละทิ้ง

Hello Teubel.
No. Unfortunately did not find a solution for this.
In my case, and since it was for a specific module, I have designed a all-in-one report with only one action for printing the report.

Sorry my friend.
Anyway, if you find a solution please post it here.
Regards

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 16
4370
2
ก.พ. 24
13980
how to print a custom report in openerp แก้ไขแล้ว
1
ต.ค. 22
5660
0
ก.ค. 21
2097
3
ธ.ค. 19
7301