首页 > 解决方案 > 没有有价值信息的 XML 错误

问题描述

我的代码有什么问题?不幸的是,错误没有提供任何有价值的信息

文件“src/lxml/lxml.etree.pyx”,第 3501 行,位于 lxml.etree。Validator.assert (src/lxml/lxml.etree.c:194922)

AssertionError: Element openerp has extra content: data, line 3

<openerp>
    <data>



        <record id="account_payment_cash_turnover_analysis_osv" model="ir.ui.view">
            <field name="name">account_payment_cash turnover analysis osv</field>
            <field name="model">account.payment.cash.turnover.analysis.osv</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Turnover Analysis">
                    <field name="date_from" />
                    <field name="date_to" />
                    <group colspan="4">
                        <field name="comp_currency" />
                    </group>
                    <footer>
                        <button name="process" string="OK" type="object" class="oe_highlight"/>
                        or
                        <button string="Cancel" class="oe_link" special="cancel"/>
                    </footer>
                </form>
            </field>
        </record>


        <wizard
                id="wizard_balance"
                model="payment.mode"
                name="account_payment_cash.balance"
                string="Balance" />

        <menuitem
                icon="STOCK_PRINT"
                action="wizard_balance"
                id="menu_wizard_balance"
                parent="menu_report_banks"/>


        <act_window name="Turnover Analysis"
                    res_model="account.payment.cash.turnover.analysis.osv"
                    view_mode="form"
                    view_type="form"
                    target="new"
                    id="act_account_wizard_reconcile_entries_osv"/>

        <menuitem
                parent="menu_report_banks"
                action="act_account_wizard_reconcile_entries_osv"
                icon="STOCK_JUSTIFY_FILL"
                id="menu_act_account_wizard_reconcile_entries_osv" />



    </data>
</openerp>

标签: xmlodoo-8odoo

解决方案


There is no conversion for tag wizard in Odoo's xml import. And that is the error telling you: wizard is content which isn't expected by the import.

So change:

<wizard
    id="wizard_balance"
    model="payment.mode"
    name="account_payment_cash.balance"
    string="Balance" />

to:

<record id="wizard_balance" model="payment.mode">
    <field name="name">account_payment_cash.balance</field>
    <field name="string">Balance</field>
</record>

I don't know, if the field names are correct, but i bet you get the idea now.


推荐阅读