Reputation: 11
I have some trouble with my report header in odoo. I can't make it appears correctly. I've made a custom report here's the code:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_timesheet">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="doc">
<div class="page">
<t t-call="report.external_layout">
#SOMESTUFF
</t>
</div>
</t>
</t>
</template>
</data>
</odoo>
The thing is my header appears twice when I run this code, I've seen from standard module example that the line
<t t-call="report.external_layout">
should be before
<div class="page">
but when I do that the header doesn't appear at all. Does anyone have any idea about what's going wrong with this?
Upvotes: 1
Views: 770
Reputation: 26698
You can create your report as following:
<template id="report_invoice_document">
<t t-call="report.external_layout">
....
</t>
</template>
<template id="report_invoice">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="account.report_invoice_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
Upvotes: 1