在系统中找不到Odoo 12报告外部ID:%s'%xmlid

时间:2019-09-20 01:47:46

标签: python report odoo odoo-12

嗨,我想做的是在odoo 12中创建报告,这是我的工作:

首先,我创建toxicwork_invoice / reports / soreport.xml,代码如下:

<odoo>
    <report
        id="so_invoices"
        model="salesorder.salesorder"
        string="Invoices"
        report_type="qweb-pdf"
        name="salesorder.report_invoice"
        file="salesorder.report_invoice"
    />
</odoo>

然后创建toxicwork_invoice / reports / invoice_card.xml,这是代码:

<odoo>

    <template id="report_invoice_cards">
        <t t-call="web.html_container">
            <t t-foreach="docs" t-as="doc">
                <h2>Faktur</h2>
            </t>
        </t>
    </template>

    <template id="report_invoice">
        <t t-call="web.html_container">
            <t t-foreach="docs" t-as="doc">
                <t t-call="report_invoice_cards"/>
            </t>
        </t>
    </template>
</odoo>

但是它给我这样的错误

raise ValueError('External ID not found in the system: %s' % xmlid) ValueError: External ID not found in the system: salesorder.report_invoice

我错过了什么?

1 个答案:

答案 0 :(得分:2)

请提供以下代码;

<odoo>
<report
    id="so_invoices"
    model="salesorder.salesorder"
    string="Invoices"
    report_type="qweb-pdf"
    name="toxicwork_invoice.report_invoice"
    file="toxicwork_invoice.report_invoice"
/>
</odoo>

<template id="report_invoice_cards">
    <t t-call="web.html_container">
        <t t-foreach="docs" t-as="doc">
            <h2>Faktur</h2>
        </t>
    </t>
</template>

<template id="report_invoice">
    <t t-call="web.html_container">
        <t t-foreach="docs" t-as="doc">
            <t t-call="toxicwork_invoice.report_invoice_cards"/>
        </t>
    </t>
</template>