Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to connect Invoice Report Template extracted into Custom Module to dropdown print menu ?

By
NSC
on 11/18/13, 6:08 PM 1,474 views

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 ...

0

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 11/18/13, 6:26 PM

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

semah
on 11/18/13, 7:05 PM
0
NSC
On 11/19/13, 12:49 PM

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 ...

NSC
on 11/19/13, 1:00 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/18/13, 6:08 PM
Seen: 1474 times
Last updated: 3/16/15, 8:10 AM