I use in my module "account__pl":
<report
id="account_invoices__pl"
model="account.invoice"
string="Invoices PL"
report_type="qweb-pdf"
name="account__pl.report_invoice_pl"
file="account__pl.report_invoice_pl"
attachment_use="True"
attachment="(object.state in ('open','paid')) and ('IPL'+(object.number or '').replace('/','')+'.pdf')"
multi="True"
/>
and in report_invoice_pl.py:
class report_invoice_pl(osv.AbstractModel):
_name = 'report.account.report_invoice'
_inherit = 'report.abstract_report'
_template = 'account__pl.report_invoice_pl'
_wrapped_report_class = parse_invoice_pl
or, in new style reports:
class report_invoice(models.AbstractModel):
_name = 'report.account.report_invoice'
_template = 'account__pl.report_invoice_pl'
@api.multi
def render_html(self, data=None):
report_obj = self.env['report']
report = report_obj._get_report_from_name(self._template)
docargs = {
'doc_ids': self._ids,
'doc_model': report.model,
'docs': self,
}
return report_obj.render(self._template, docargs)
class report_invoice_pl(report_invoice):
_name = 'report.account__pl.report_invoice_pl'