Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5750 Lượt xem

I am trying to replace the invoice report with my own one. We don't use rml and use jrxml from jasper report.

I replace the invoice rml report with a jrxml report. I want to use my own parser for it.

            <delete model="ir.actions.report.xml" search="[('report_name','=','account.invoice')]" />

            <report id="account_invoices_mylayout"
            string="Invoices with MyLayout"
            model="account.invoice"
            name="account.invoice.mylayout"
            rml="../mypath/report1.jrxml"
            auto="False"/>

The previous code will only remove original invoice report and replace it with a jasper report with default model source. How can I change the model to use my parser without wizard ?

In the parser class

    jasper_report.report_jasper('report.' + REPORT_NAME, REPORT_MODEL, parser=my_parser)
Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

REPORT_NAME had to match name of the report in the view ----> name="account.invoice.mylayout"

jasper_report.report_jasper('report.account.invoice.mylayout', ....)

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 15
4404
2
thg 7 24
2959
2
thg 4 24
2793
1
thg 6 23
1825
4
thg 10 20
5724