This question has been flagged
2 Replies
7010 Views

I'm new to openerp and using version 7. I'm trying to create a new module using the instructions from the link below:

http://acespritechblog.wordpress.com/2012/05/22/how-to-create-a-module-in-openerp/

But when i try to install the module all i'm getting is "Error occurred while validating the field(s) arch: Invalid XML for View Architecture!" is there a way to debug this? What part of my view is wrong? Everything i did is the same with the link but here is the view XML anyway:

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

<openerp>
    <data>
       <record model="ir.ui.view" id="test_base_form">
           <field name="name">test.base.form</field>
               <field name="model">test.base</field>
               <field name="type">form</field>
               <field name="arch" type="xml">
                   <form string="Test Base">
                       <field name="name"/>
                       <field name="code"/>
                   </form>
              </field>
        </record>

        <record model="ir.ui.view" id="test_base_tree">
            <field name="name">test.base.tree</field>
            <field name="model">test.base</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Test Base">
                    <field name="name"/>
                    <field name="code"/>
                </tree>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_test_seq">
            <field name="name">Test Base</field>
            <field name="res_model">test.base</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>

        <menuitem id="menu_test_base_main" name="Test Base"/>
        <menuitem id="menu_test_base" parent="menu_test_base_main" name="Test Base" action="action_test_seq"/>

    </data>
</openerp>

Avatar
Discard
Best Answer

Did you try to restart openerp?

 

In Debian/Ubuntu Linux just do:

$ sudo service openerp restart

 

Then login and find the module and click upgrade.  Sometimes openerp/postgresql needs to first restart before your xml files are recognised.

Avatar
Discard
Author

It actually worked thanks but i can't mark your answer as the correct one because of my karma i guess.

Best Answer

Hi..

Your xml looks fine... just check wether your python objects are loaded.. check whether py files are imported in __init__.py...

Avatar
Discard