I'm new to programming for OpenERP 7.0, When you import this module to OpenERP gives me an error:ValidateError Error occurred while validating the field(s) arch: Invalid XML for View Architecture!. I`m not locate the error. I would be very grateful if you help me. thanks.
_init_.py
import new_test
_openerp_.py
{
'name': 'New Test demo',
'version': '1.0',
'author': 'nasr2ldin',
'category': 'Human Resources',
'summary': 'Document registration',
'website': '',
'description': """
This is a New Test demo Module by nasr2ldin
""",
'images': [],
'depends': ['base','hr', 'base_calendar'],
'init_xml': [],
'update_xml': ['new_test_view.xml'],
'installable': True,
'application': True,
'auto_install': False,
}
new_test.py
import datetime
import time
from itertools import groupby
from operator import itemgetter
import math
from openerp.osv import fields, osv
from openerp.tools.translate import _
def _employee_get(obj, cr, uid, context=None):
if context is None:
context = {}
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context)
if ids:
return ids[0]
return False
class new_test(osv.osv):
_name = "new_test.register"
_description = "New Test Demo"
_columns = {
'new_test_name': fields.char('User Name',size=256),
'new_test_desc': fields.selection([('18-20','18-20'),('20-30','20-30')],'User Age.'),
'new_test_about': fields.char('About'),
'new_test_date': fields.date('Date')
}
new_test()
new_test_view.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="new_test_form" model="ir.ui.view">
<field name="name">new_test.line.form</field>
<field name="model">new_test.register.</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="New Test" version="7.0">
<field name="sequence" invisible="1"/>
<field name="new_test_employee"/>
<field name="new_test_name"/>
<field name="new_test_desc"/>
<field name="new_test_about"/>
<field name="new_test_date"/>
</form>
</field>
</record>
<record id="new_test_tree" model="ir.ui.view">
<field name="name">new_test.tree</field>
<field name="model">new_test.register</field>
<!-- <field name="type">tree</field>
--> <field name="arch" type="xml">
<tree string="New_test" colors="blue:state=='draft'">
<field name="employee_id"/>
<field name="department_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="new_test_name"/>
<field name="new_test_desc"/>
<field name="new_test_about"/>
<field name="new_test_date"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_penalty">
<field name="name">new_test</field>
<field name="res_model">new_test.register</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="new_test_register" name="New Test Register" parent="hr.menu_hr_root" sequence="25"/>
<menuitem id="new_test_register_main" name="New Test register" parent="new_test_register" action="action_new_test" sequence="20"/>
</data>
</openerp>