0
votes

Hi Friends I have used Qweb to generate the pdf report in odoo 9 now i can download the pdf file but the file does not showing the data

Generated PDF

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_invoice">
    <t t-call="report.html_container">
        <t t-foreach="docs" t-as="o">
           <t t-call="report.external_layout">
                <div class="page">
                <div class="row">	
                    <h2 class="text-center" style="font-size: 24px;font-weight: bold;">company </h2>
                         <p>This object's name is <span t-field="o.name"/></p>
                  </div>
                </div>
            </t>
        </t> 
    </t>
</template>
</odoo>
1
What version of wkhtmltopdf are you running? Execute wkhtmltopdf -V if running on linux from the terminal. To ensure the report is working at all replace everything inside of your page div with a static <h1>HELLO WORLD</h1> to verify your report is working and properly setup with odoo. Next Add in data. You want wkhtmltopdf 0.12.1 or higher.Phillip Stack
Show us how you declare your report as mentioned in https://www.odoo.com/documentation/8.0/reference/reports.htmlGeorge Daramouskas
hi phillipstack i am using the version -- wkhtmltopdf 0.12.2.1 (with patched qt) and i have tried it with the h1 but it also not workedj.v.manoj kumar
hi george i called the pdf download action while clicking the button download here is my code to call the id @api.multi def print_report(self): datas = {} if self._context is None: self._context = {} data = self.read()[0] datas = { 'ids': [], 'model':self._name, 'form': data } return self.env['report'].get_action(self, 'module.report_invoice', data=datas)j.v.manoj kumar
hello phillipstack i tried this code the problem was not fixedj.v.manoj kumar

1 Answers

1
votes

i have changed the return of the function which will print the pfd it worked for me

return {
                        'type': 'ir.actions.report.xml',
                        'report_name': 'module.report_invoice',
                        'datas': datas,
                        }