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

Hi Community,

I have just succeeded in extracting account.invoice report template to an own, external module. If I try to print an outgoing invoice, everything behaves as expected - my modified invoice template is filled and printed. But only, if I use the print button of the button bar directly above the invoice inserting mask. If I use the print option of the print menu further above (this dropdown one), an error occurs: KeyError(u'report.report.account.invoice'

You may think now, why don't you simply always use the print button working with your new template? Yes... But regarding incoming invoices, such a button does not exist - in this case, I need to use the print button out of the dropdown print menu. Therefore, at the moment, I can not print any incoming invoices with my customization.

Can you therefore give me an advice how to connect my new report template to the dropdown print menu, too?

Many thanks in advance ...

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

That report comes with this:

<report
        auto="False"
        id="account_invoices"
        model="account.invoice"
        name="account.invoice"
        rml="account/report/account_print_invoice.rml"
        string="Invoices"
        attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
        attachment_use="True"
        usage="default"
        />

on account/account_report.xml

So you have to modify this too, this adds the print button

อวตาร
ละทิ้ง

Don't forget to add account_report.xml to "update_xml" in __openerp__.py

ผู้เขียน คำตอบที่ดีที่สุด

Thanks, you were a great help for me! Obviously an id mismatch in xml-File. Took same id and name as you posted above and now my module seems to have full functionality!

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

Sorry, I still did not find out how to copy and paste formatted source here ...

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 22
2631
2
ก.ย. 24
11340
Print Multiple Invoices Fails Odoo CE 11 แก้ไขแล้ว
4
เม.ย. 22
4892
2
มี.ค. 18
4138
1
ก.ย. 17
6616