Hello, I am starting developing openerp modules. What could be wrong with the following code:
school.py
from openerp.osv import osv,fields
class school(osv.osv):
_name = "school"
_description = "This will hold the school information"
_columns = {
'school_name': fields.char('School Name', size=30,required=True),
'address': fields.char('Postal Address', size=50 , required=True),
'city': fields.char('City', size=30, required=True),
}
school()
school_view.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="school_base_form">
<field name="name">school.form</field>
<field name="model">school.school</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="School">
<field name="school_name"/>
<field namme="address"/>
<field name="city"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_school_form">
<field name="name">school</field>
<field name="res_model">school.school</field>
</record>
<menuitem name="School Management" id="school_menu" />
<menuitem name="Schools" parent="school_menu" id="schools_menu" action="action_school_form" />
</data>
</openerp>
I am getting the error: ValidateError Error occurred while validating the field(s) arch: Invalid XML for View Architecture!
What could be the problem?
Possible duplicate of Invalid XML Architecture when trying to create a view.
Corrected as per this question but still it doesn't work.
Look at my answer, either you did not change the post or you still have the same problem. _name in .py, model in view definition and res_model in action definition should all be te same!