Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Can't find field 'company' in the following view parts composing the view of object model 'mymodule.test' ?

By
santoshnayak
on 8/23/13, 3:25 AM 868 views

I'm new to OpenERP v7, i tried to install one new module, but getting validation error "Error occurred while validating the field(s) arch: Invalid XML for View Architecture! " Any suggestion will be greatly appreciate. Below is all basic required files for OpenERP v7.

__init__.py

from mymodule import mymodule_test

__openerp__.py

{ 'name': 'mymodule', 'version': '1.0', 'category': 'My own Module', 'description': """

The kernel of OpenERP, needed for all installation.

""", 'author': 'SANTOSH', 'maintainer': 'SANTOSH', 'images' : ['images/icon.jpg'], 'depends': ['base'], "init_xml" : [], "update_xml" : ["mymodule_menu.xml"], 'data': [ 'mymodule_menu.xml',

],
'demo': [
    'mymodule_menu.xml',
],
'test': [
    'mymodule_menu.xml',
],

'installable': True,
'auto_install': False,
'active': True

}

mymodule.py

from openerp.osv import fields, osv

class mymodule_test(osv.osv): _name = "mymodule.test" _column = {'name':fields.char('Name',size=256, Required = True ), 'company':fields.char('Company', size = 256, Required = True), }

mymodule_test()

mymodule_menu.xml

<openerp> <data> <menuitem id="section_main_menu" name="Mymodule"/> <menuitem id="menuitem_id" name="MymoduleList" parent="section_main_menu"/> <record model="ir.ui.view" id="mymodule_view_form" >="" <field="" name="name">Mymodule</field> <field name="model">mymodule.test</field> <field name="arch" type="xml"> <form string="Mymodule" version="7.0" >="" <field="" name="name"></field> <field name="company"></field> </form> </field> </record>

    <record  model="ir.ui.view" id="mymodule_view_tree" >
        <field name="name">Mymodule</field>
        <field name="model">mymodule.test</field>
        <field name="arch" type="xml">
            <tree string="Mymodule" version="7.0" >
                <field name="name"></field>
                <field name="company"></field>
            </tree>
        </field>
    </record>

    <record id="action_mymodule" model="ir.actions.act_window">
        <field name="name">mymodule</field>
        <field name="res_model">mymodule.test</field>
        <field name="view_type">tree</field>
        <field name="view_mode">tree,form</field>
    </record>
</data>

</openerp>

0
joseph d'souza
On 8/23/13, 4:02 AM

wrongly set __init__.py

Try this in __init__.py

import mymodule

Thanks for ur suggestion. I changed in __init__.py, but still getting same error...

santoshnayak
on 8/23/13, 4:26 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/23/13, 3:25 AM
Seen: 868 times
Last updated: 3/16/15, 8:10 AM