Hi, i am using odoo11.
I wanted to experiment with custom reports for accounting. So I added a special "print invoice griglia" in the print menubar by means of the following code:
<?xml version="1.0" encoding="utf-8"?> <odoo> <data> <report id="custom_invoice_griglia" model="account.invoice" string="Invoices griglia" report_type="qweb-pdf" name="custom_invoice.report_invoice_griglia" file="custom_invoice.report_invoice_griglia" attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')" print_report_name="(object._get_printed_report_name())" />
<template id="report_invoice_griglia"> <t t-call="web.html_container"> <t t-foreach="docs" t-as="o"> <t t-call="custom_invoice.report_invoice_griglia" t-lang="o.partner_id.lang"/> </t> </t> </template>
<template id="report_invoice_griglia"> <t t-if="not o and doc"> <t t-set="o" t-value="doc"/> </t> <t t-if="o and 'company_id' in o"> <t t-set="company" t-value="o.company_id.sudo()"/> </t> <t t-if="not o or not 'company_id' in o"> <t t-set="company" t-value="res_company"/> </t> <t t-call="web.html_container"> <div class="article" style="margin-top:0px;padding-top:0px;"> Hello there </div> </t> </template> </data> </odoo>
And it sorta works: i effectively end up with a blank pdf file containing the "Hello there" string. The only problem is that there's a lot of blank space on top of the page, before the "hello there".
I tried to fix it by merely setting margin and padding of the 'page' tag to zero, but this does not appear to have any affect. I also noticed that if you remove the class="article" attribute, no page is generated and an empty pdf is outputted instead.
So i tried to find some css rule for "article" by grepping:
grep -rl "\.article" *
but no result is found.
So where does the space at the top of a blank report come from? Is there a way to get rid of it? Thank you very much in advance for any help!