I created module that overrides default invoice and it should use different rml file making it easy to change without changing anything in original account module. But somehow it still used old rml file even though in settings/actions/reports, it shows that report is using my custom rml which is located in my module. When I edit my rml file, nothing changes. When I edit original rml file (that should be overriden and shouldn't affect what will be printed in invoice) it changes my printed invoice, when I edit my rml file nothing changes. Is something went wrong?
My module: print_invoice.py
import time
from openerp.report import report_sxw
class account_invoice(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(account_invoice, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
report_sxw.report_sxw(
'report.custom.account.invoice',
'account.invoice',
'addons/report_custom_invoice/report/account_print_invoice_custom.rml',
parser=account_invoice
)
xml file:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
auto="False"
id="account.account_invoices"
model="account.invoice"
name="custom.account.invoice"
rml="report_custom_invoice/report/account_print_invoice_custom.rml"
string="Invoices"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
usage="default"
multi="True"
/>
</data>
</openerp>
__openerp__.py:
{
'name': 'Custom Invoice template',
'version': '1.0',
'depends': ['base_registry_code'],
'author': 'OERP',
'description': """
Account Print Invoice
==========================================
This module customizes default invoice. It adds company registry code in invoice template.
""",
'website': '',
'category': 'report',
'demo': [],
'test': [],
'data': ['account_invoice_report.xml'
],
'auto_install': False,
'installable': True,
}
Make sure you have import py file in
__init__.py
.I have import py file in report/__init__.py
Did you add xml file in
__openerp__.py
?