【问题标题】:Odoo 12 Report External ID not found in the system: %s' % xmlidOdoo 12 报告系统中未找到外部 ID:%s' % xmlid
【发布时间】:2019-09-20 01:47:46
【问题描述】:

嗨,我想做的是在 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

我错过了什么?

【问题讨论】:

    标签: python report odoo odoo-12


    【解决方案1】:

    请给出以下代码;

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-30
      相关资源
      最近更新 更多