[Python] How to find the root cause of "Element odoo has extra content: data"

Discussão em 'Python' iniciado por Stack, Abril 5, 2025.

  1. Stack

    Stack Membro Participativo

    The error message


    "Element odoo has extra content: data"
    ​

    may be generated if an xml file such as a view fails to validate against the RELAXNG schema file odoo/odoo/import_xml.rng. Unforunately it isn't very specific. For example, this file:

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

    <record id="record_id" model="ir.ui.view">
    <field name="name">foo.bar.form</field>
    <field name="model">baz.model</field>
    <field name="arch" type="xml">
    <form string="My Form">
    <sheet>
    <group>
    <field name="my_field"/>
    </group>
    </sheet>
    </form>
    </field>
    </record>

    <act_window id="action_quux" name="My Action" res_model="baz.model" view_model="form"/>

    </data>
    </odoo>


    will generate the message when validated, but there is no indication that the specific problem is that view_model should be view_mode. Is there a way to get a better error message?

    Continue reading...

Compartilhe esta Página