콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
26324 화면

Given this report definition, how can I change the file name used in the PDF so it uses names such as "SO-001.pdf".

<report
        id = "report_custom_sale_order"
        string = "Quotation / Order"
        model = "sale.order"
        report_type = "qweb-pdf"
        file = "custom_saleorder.report_saleorder"
        name = "custom_saleorder.report_saleorder"
        paperformat = "custom_saleorder.paperformat_a4"
/>

Odoo 10.

Thanks

아바타
취소
베스트 답변

Add 'print_report_name' in your custom module

<report
        id = "report_custom_sale_order"
        string = "Quotation / Order"
        model = "sale.order"
        report_type = "qweb-pdf"
        file = "custom_saleorder.report_saleorder"
        name = "custom_saleorder.report_saleorder"
        paperformat = "custom_saleorder.paperformat_a4"
        print_report_name = "(object.name+'.pdf')"
/>
아바타
취소

then I add print_report_name = ... it fails with:

AssertionError: Element odoo has extra content: data, line 3

without this works fine

for avoiding AssertionError: Element odoo has extra content: data, line 3.

need to inehrit same report like this:

<record model="ir.actions.report.xml" id="sale.report_sale_order">

<field name="print_report_name">(object.name+'.pdf')</field>

</record>

베스트 답변

Hi,

you  can do it like this, activate the developer mode, then go to Settings -> Technical ->reports ->reports, select the report of the sales, ie , report named Quotation / Order. Then open the report and add "((object.name or '').replace('/','')+'.pdf')" this to field Printed Report Name. Then go to sales and print the report

Thanks

아바타
취소
작성자

Thanks, but I want to do it programmatically so I can easily setup the same in other databases. It is a custom module.

관련 게시물 답글 화면 활동
1
11월 17
5735
1
9월 19
3622
1
6월 19
5682
1
9월 17
3498
0
7월 17
3671