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.

9

multiple invoice layout

By
klaas vortex
on 3/26/13, 1:15 PM 24,658 views

I would like to have multiple layouts on the invoice. Under the print button you get 'invoices' I would like to see more choices of custom made layout invoices.

Something like [PRINT] - invoice std - invoice special - invoice foreign Where the names are also custom depending on the layout.

We use the delivery address as a location reference so this should be printed on the invoice in some cases.

Is this possible ? If so how do I do this ?

PS. I have tried the OpenOffice template editor module but this ruined my openerp-print-invoice.

13

IBS

--IBS--
1302
| 4 5 8
Tétouan, Morocco
--IBS--

For more informations about IBS, please visit our website at www.ibs-na.com.

For a specific questions, collaboration or help, please send us an email to support@ibs-na.com

IBS
On 3/26/13, 5:37 PM

Note: Make sure you have administration privileges and in user Access Rights you have Technical Features checked.

You need the following:

  • A new/modified/existing RML invoice template that should be saved in addons/account/report or anywhere you like.
  • a new Report Action
  • and an Action Binding for it.

Report Action

  • Go to Settings->Technical->Actions->Reports and search for invoice
  • click the More drop down list and select Duplicate to create a new identical entry, all you have to change is the Name and the Report File location

Action Binding

  • Go to Settings->Technical->Actions->Action Bindings
  • Again look up invoice
  • Duplicate it the same way you did for the report, but in Action (change only) write the name of the new report you just created earlier.

You are done, you will now have 2 options in the invoice Print drop down list.

You can have as many reports as you like and this works for all other types of reports, not just invoices.

PS: Make sure that the Action Binding for the new Report has the Qualifier set to client_print_multi

Update: You need a report python file to define the report service, this is an example for a secondary invoice report:

import time

from openerp.report import report_sxw

class account_invoice_secondary(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context=None):
        super(account_invoice_secondary, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({
            'time': time, 
        })

report_sxw.report_sxw( 'report.account.invoice.secondary', 'account.invoice', 'account/report/account_invoice_secondary_report.rml', parser = account_invoice_secondary )

Make sure to configure your report to have the service name account.invoice.secondary

name your file account_invoice_secondary_report.py and put it in account/report/ and lastly, import it in accounts/report/__init__.py

Restart your server and it should work.

Hi, just wondering how you sorted it out. I followed step by step the whole procedure, and still the same first rml report is used, whatever the line i am using in the Print drop down list.

Christian Douville
on 3/29/13, 2:22 PM

Did you change the Report File field in your new report? Because it should be different from the default one.

IBS
on 3/29/13, 2:27 PM

Yes, this was the first field value changed. Does it work on your side with two different Report files ?

Christian Douville
on 4/2/13, 8:38 AM

It should, is your server on a Windows machine?

IBS
on 4/2/13, 9:16 AM

Nope, this is a Linux one

Christian Douville
on 4/2/13, 9:18 AM

Hello. Looking now to the script from the module, i seems the module is able to process only one single entry (the first one) within the Settings - Technical/Actions/Reports record set. Hence, it cannot work the way i was expecting. And the only way i can imagine now is to manage the Security tab so that i make sure that a User can "see" only one entry within the set, and so should the expected behavior be ensured.

Christian Douville
on 4/4/13, 5:20 AM

Did you make sure that the corresponding Action Binding has the Qualifier set to client_print_multi ?

IBS
on 4/4/13, 9:52 AM

Yes, i did. As i am not able to illustrate the module script which keep the only first occurrence for processing, there is nothing much i can provide, else than a suspicion on the script from the module. Thanks.

Christian Douville
on 4/4/13, 9:56 AM

I have followed your instructions to the letter, but I still have only one option under my dropdown. I am using Windows, does this work differently for this OS?

Rebel
on 4/9/13, 10:02 AM

It should work for Windows, please make sure that the Action Binding for the new Report has the Qualifier set to client_print_multi

IBS
on 4/9/13, 7:54 PM

Well I tried numerous times but haven't got it set up yet. :(

To recapitulate, there are two things which I am not entirely certain of; based on your description. For "Action Bindings" you say "look up Invoice"; do you mean the binding "Invoice" (account.analytic.account) or "account.invoice" (account.invoice)? [I already tried both, but want to be sure now]

Also for the "Action (change only)" field, I am not sure if I did it right. I made a new record with: Name = account_print_invoice_FR.rml, Type of action = ir.actions.report.xml. Do I need to select an existing record, which one?

Rebel
on 4/10/13, 8:04 AM

I already had the qualifier set to client_print_multi, as you recommended higher up in the thread.

UPDATE: I can't edit the above comment, but I figured I should use "ir.actions.act_window" as type for the action instead of what I specified earlier. I also guess I should use "Invoice" (account.analytic.account), rather than "account.invoice"; because otherwise it will result in view errors on the invoices. HOWEVER: it still doesn't work. :/ I can't figure out what I'm doing wrong, as I've done it over 10 times by now - and am convinced my settings appear to be configured correctly.

Rebel
on 4/10/13, 8:05 AM

What is the name of the report you are trying to print?

IBS
on 4/20/13, 3:19 PM

currenrtly invoiceFR.rml

Rebel
on 5/2/13, 11:40 AM

I tried this solution and It worked perfect for me!

Many, Many thanks for your answer Karim!

If anybody want to know my exact steps please let me know.

With Kind regards,

Michael Bos

Ps. I made a brand new incoming shipment document, with print options and all.

Mibo, Michael Bos
on 6/22/13, 7:57 AM

the same like the old report, Kindly Michael let me know how i can do it

Mahmoud
on 7/8/13, 6:51 AM

thanks it works for me

Mohamed Essakali
on 7/14/13, 4:21 PM

I have two invoices: have account_print_invoice.rml and account_print_invoice_new.rml I duplicated invoice records in Reports and Action Bindings. The name in Reports is Invoice New and Report File is account/report/account_print_invoice_new.rml The name in Action Bindings is Invoice New and Action Reference is ir.actions.report.xml,334 – which links to Reports / Invoice New. There are two options under Invoice / Print button: Invoice and Invoice New, which is correct. The PROBLEM is both print account_print_invoice_new.rml. I can not print the default account_print_invoice.rml anymore. Why???

Macopedia Sp. z o.o, Dariusz Kubiak
on 7/30/13, 1:26 PM

I have the very same problem as 62552; both print the same form; I am using v7 for Windows and just cant figure out WHY!

Mayte Montaño
on 8/7/13, 2:25 PM

same problem with 62552, 57672, I'm using ubuntu 12.04 , openerp v7. Anyone know how to solve this?

phoebe
on 8/20/13, 3:35 AM

This is really nice solution but i got a problem (Report has not been downloaded Detail: URL seems to be an unsupported one) when i try to modify new report through openoffice (modify existing report).

waqar
on 9/12/13, 5:47 AM

Michael Bos let us know how do yo do it?

Manuel Fernando Caicedo
on 12/3/13, 3:08 PM

I am sorry for my late reaction. I am not nearby a real computer untill the weekend. I will then post this as a solution. Thank you!

Mibo, Michael Bos
on 12/11/13, 3:02 AM

Hello Thanks it's work for me , but the problem in traslation i can not translate my second invoice which directory is same as invoice directory

Atul Kumar jain
on 6/2/14, 8:36 AM
2
David Birchmier
On 12/27/14, 8:50 PM

I created a step by step guide with screenshots on how to do this using Odoo v8. I struggled with this for a long time (being new to Odoo myself) and I hope this guide will help save others the same frustration I went through.

 

Here's the guide to Create Multiple Invoice Templates in Odoo v8:
http://www.askmpa.com/creating-multiple-invoice-templates-in-odoo-v8/

link is dead

Pascal Tremblay
on 2/10/15, 7:38 AM

Still working here, Pascal: http://www.askmpa.com/creating-multiple-invoice-templates-in-odoo-v8/ Is there an error you're getting?

David Birchmier
on 2/11/15, 1:20 AM
2
Sandra Weiß
On 2/4/14, 10:04 AM

hi all,

we spent a lot of time figuring out how to make multiple layouts working. finally we did it and we wan't to share our experiences with you.

for a detailed documentation about creating multiple sale order layouts have a look at the following link. this documentation may also be used to create other additional layouts/reports.

10 seconds later: when trying to post this answer I received: "Could not post, because your karma is insufficient to publish links"

therefore: please go to www.onestep2.at/en -> Support -> Knowledge database -> OpenERP - FAQ -> OpenERP7 - Multiple sale order, invoice layouts, reports

we used a lot of images for documentation purposes. therefore we're not able to do a simple copy/paste to this forum.

direct link to the documentation article at oneStep2: www.onestep2.at/en/forum/openerp7-multiple-sale-order-invoice-layouts-reports

kind regards, sandra oneStep2

Thank's Sandra. I follow your steps but when I duplicate the action binding I can't see the action (change only) previusly created. I don't have Quotation / Order / Other_layout because It isn't an action it's an action report. Thanks in advance

Iñaki Resúa Villanueva
on 2/4/14, 12:11 PM

Hi, yes, it is an action, but it can be selected if you have previously created this new report...did you follow step by step our documentation?

Sandra Weiß
on 2/10/14, 5:19 AM

Hello Thanks it's work for me , but the problem in traslation i can not translate my second invoice which directory is same as invoice directory

Atul Kumar jain
on 6/2/14, 8:37 AM
1
yeshwanth
On 2/10/15, 5:31 AM

Friends i too faced the same problem and got a solution. 

We can create a duplicate invoice from the existing one. check this link : http://www.askmpa.com/creating-multiple-invoice-templates-in-odoo-v8/

Thank you and Enjoy

0
Mantavya Gajjar (mga)
On 7/15/14, 12:43 AM

It is not that much complex to define multiple invoices for the invoice, you might not have seen https://www.odoo.com/apps/7.0/l10n_in_tax_retail_invoice/ module that already support printing of multiple invoices with configuration. of course if your own custom format installed it will detect and print up on the configuration

May be it is not direct solution but it gives you best example to keep and print invoices in multiple layouts.

0
Julius
On 10/23/13, 1:54 PM

I have two invoices: have account_print_invoice.rml and account_print_invoice_new.rml I duplicated invoice records in Reports and Action Bindings. The name in Reports is Invoice New and Report File is account/report/account_print_invoice_new.rml The name in Action Bindings is Invoice New and Action Reference is ir.actions.report.xml,334 – which links to Reports / Invoice New. There are two options under Invoice / Print button: Invoice and Invoice New, which is correct. The PROBLEM is both print account_print_invoice_new.rml. I can not print the default account_print_invoice.rml anymore. Why???

I can confirm this bug is lasting for months ... The two reports print the same thing, when they're created as explained by Karim

prueba modificando los ficheros: __init__.py y account_print_invoice_new.py

adn
on 10/26/13, 8:46 AM

Hello Thanks it's work for me , but the problem in traslation i can not translate my second invoice which directory is same as invoice directory

Atul Kumar jain
on 6/2/14, 8:39 AM
0
Ben Brosch
On 11/14/14, 11:03 AM

I found this article for Odoo 8 using multiple QWeb reports: http://odoo.guide/multiple-report-layout-step-by-step/

It worked for me in testing environment. But I'm not sure if one should use direct table manipulation via SQL statements in production systems.

0
Mahmood AlAsfoor
On 8/29/14, 4:08 PM

Thanks for this great enhancement How can I print customer detail on POS Receipt/tickets

0

patrick

--patrick--
1958
| 5 4 7
Baarn, Netherlands
--patrick--
patrick
On 3/26/13, 1:47 PM

I have noticed that when you use the default invoices, it will be translated into the language of the language you have defined the user. I have not checked what will happen if you have a customer/company in language A and the invoice address is with someone in language B.

I expect that it will use the language depending on whom you send the various reports/orders.

In order for the documents to be translated, you have to load / import the appropriate language.

Settings -> Load a Translation.

After this, you can specify another language on the user, so the system might try to translate (using strings in the database, don't expect magic) the standard documents.

If you have customized documents and/or modified text, you have to add those strings to the database as well. I have not done that yet, so I cannot give you any answers/hints regarding this issue.

This is really a nice tutorial but I got problem (Report has not been downloaded Detail: URL seems to be an unsupported one) when I tried to modify new report through openoffice(modify existing report). I just copy purchase_requisition.rml file and paste somewhere else and rename this file comparative_statement.rml and again paste this file in report folder of purchase requisition and follow the procedure that you have mentioned above, now I am able to see two option under print button both are working but my question is how to modify new report comparative statement?

waqar
on 9/12/13, 5:54 AM

Hello Thanks it's work for me , but the problem in traslation i can not translate my second invoice which directory is same as invoice directory

Atul Kumar jain
on 6/2/14, 8:38 AM

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

14 follower(s)

Stats

Asked: 3/26/13, 1:15 PM
Seen: 24658 times
Last updated: 11/7/16, 6:06 PM