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.