0

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>
Phillip Stack
  • 3,308
  • 1
  • 15
  • 24
  • 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 `

    HELLO WORLD

    ` 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 Oct 14 '16 at 15:45
  • Show us how you declare your report as mentioned in `https://www.odoo.com/documentation/8.0/reference/reports.html` – George Daramouskas Oct 14 '16 at 19:32
  • 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 worked – j.v.manoj kumar Oct 15 '16 at 03:37
  • 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 Oct 15 '16 at 03:42
  • hello phillipstack i tried this code the problem was not fixed – j.v.manoj kumar Oct 15 '16 at 04:06
  • hello phillipstack i tried this code the problem was not fixed

    Report For

    – j.v.manoj kumar Oct 15 '16 at 04:15

1 Answers1

1

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,
                        }