Odoo9自定义打印选项显示内部服务器错误

时间:2017-01-18 06:23:28

标签: openerp odoo-8 odoo-9

在PDF中显示内部服务器错误。任何解决方案?

1.查看

<button name="print_button" string="Print" type="object" states="approved" />  

2。报告视图

<?xml version="1.0" encoding="utf-8"?>
    <openerp>
        <data>

            <report 
                id="print_expense_report"
                string="Expenses"
                model="custom.expenses" 
                report_type="qweb-pdf"
                file="custom_expenses.report_without_prices" 
                name="custom_expenses.report_without_prices" 
            />

        </data>
    </openerp>

3。打印视图

    <?xml version="1.0" encoding="utf-8"?>
    <!--Custom report.-->
    <openerp>
    <data>

    <template id="report_without_prices_document">

            <div class="page">
                <div class="row">
                    <h3>Title1</h3>
                </div>
            </div>

    </template>

    <template id="report_without_prices">
        <t t-call="report.html_container">
            <t t-foreach="docs" t-as="doc">
                <t t-call="report_without_prices_document" t-lang="doc.partner_id.lang"/>
            </t>
        </t>

    </template>

    </data>
    </openerp>    

3。模块

@api.multi
def print_button(self):
        return self.env['report'].get_action(self, 'custom_expenses.report_without_prices')

0 个答案:

没有答案