使用Qweb在odoo 9中生成pdf报告

时间:2016-10-14 13:28:31

标签: openerp qweb

嗨朋友我使用Qweb在odoo 9中生成pdf报告现在我可以下载pdf文件,但文件没有显示数据

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>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

我已经更改了函数的返回值,这将打印它为我工作的pfd

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