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

error on clicking 'Install'-ValidateError Error occurred while validating the field(s) arch: Invalid XML for View Architecture!

By
sneha antony
on 3/5/14, 7:10 AM 1,279 views

I developed a module in openerp 7 and added the module to the addons folder thru /opt/openerp/server/openerp/addons.When the modules list is updated,the new module is visible in the installed modules list.The issue is when i click the Install Button in the module,there appears an error like this ,in a box. ValidateError

Error occurred while validating the field(s) arch: Invalid XML for View Architecture!

I tried for a long to debug the issue but didn't find the real problem yet.It seems that the problem is with the .xml file(or maybe .py file).Both the files are attached.

warranty_info.py

from openerp.osv import osv, fields

class warranty_warranty(osv.osv):

_name = 'warranty.warranty'

_columns = {
    'name':fields.many2one('res.partner','Customer Name'),
'contract':fields.many2one('account.analytic.account','Contract'),
'batch_no':fields.char('Batch No.'),
'status':fields.selection([('open','Open'),('close','Close')],'Warranty Status'),
'serial_no':fields.char('Serial No.'),
'notes':fields.text('Details'),
    'line_ids': fields.one2many('order.line','ordr_id',"PREVENTIVE MAINTENANCE"),

}

warranty_warranty()

class order_line(osv.osv):

_description = "Order Line" 

_name = "order.line"

_columns = {
'ordr_id': fields.many2one('warranty.warranty', 'ID'),
'date': fields.date('Date'),
'pm_status': fields.selection([('pending','Pending'),('complete','Complete')],'Preventive Maintenance Status'),

}

order_line()

warrranty_info_view.xml

<openerp> <data>

<record model="ir.ui.view" id="warranty_search"> <field name="name">warranty.search</field> <field name="model">warranty.warranty</field> <field name="type">search</field> <field name="arch" type="xml"> <search string="warranty information search"> <field name="name" string="Name"/> <field name="contract" string="Contract"/> </search> </field> </record>

<record id="warranty_warranty_tree" model="ir.ui.view"> <field name="name">warranty.result.tree</field> <field name="model">warranty.warranty</field> <field name="type">tree</field> <field name="arch" type="xml"> <tree string="warranty_result">
<field name="name"/>
<field name="contract"/> <field name="batch_no"/> <field name="status"/>
<field name="serial_no"/> </tree> </field> </record>

<record id="warranty_warranty_form" model="ir.ui.view"> <field name="name">warranty.result.form</field> <field name="model">warranty.warranty</field> <field name="arch" type="xml"> <form string="Warranty_result" version="7.0">
<sheet> <group> <group> <field name="name"/>
<field name="contract"/> <field name="batch_no"/> <field name="status"/>
<field name="serial_no"/> <field name="notes"/> </group> </group> <notebook> <page string="Preventive Maintenance"> <field name="line_ids"> <tree string="Preventive Maintenance" editable="bottom"> <field name="date"/> <field name="pm_status"/> </tree> </field> </page> </notebook> </sheet> </form> </field> </record>

<record id="action_warranty_warranty" model="ir.actions.act_window"> <field name="name">Warranty Details</field> <field name="res_model">warranty.warranty</field> <field name="view_type">form</field> <field name="view_mode">tree,form</field> </record>

<menuitem id="warranty_parent" name="Warranty"/> <menuitem id="menu_warranty_parent" name="Warranty Management" parent="warranty_parent"></menuitem> <menuitem action="action_warranty_warranty" id="menu_warranty_warranty" parent="menu_warranty_parent" string="Result"/> </data> </openerp>

0
sridhar
On 3/5/14, 7:18 AM

<openerp> <data>

<record model="ir.ui.view" id="warranty_search"> <field name="name">warranty.search</field> <field name="model">warranty.warranty</field> <field name="type">search</field> <field name="arch" type="xml"> <search string="warranty information search"> <field name="name" string="Name"/> <field name="contract" string="Contract"/> </search> </field> </record>

<record id="warranty_warranty_tree" model="ir.ui.view"> <field name="name">warranty.result.tree</field> <field name="model">warranty.warranty</field> <field name="type">tree</field> <field name="arch" type="xml"> <tree string="warranty_result"> <field name="name"/> <field name="contract"/> <field name="batch_no"/> <field name="status"/> <field name="serial_no"/> </tree> </field> </record>

<record id="warranty_warranty_form" model="ir.ui.view"> <field name="name">warranty.result.form</field> <field name="model">warranty.warranty</field> <field name="arch" type="xml"> <form string="Warranty_result" version="7.0"> <sheet> <group> <group> <field name="name"/> <field name="contract"/> <field name="batch_no"/> <field name="status"/> <field name="serial_no"/> <field name="notes"/> </group> <notebook> <page string="Preventive Maintenance"><group> <field name="line_ids"> <tree string="Preventive Maintenance" editable="bottom"> <field name="date"/> <field name="pm_status"/> </tree> </field> </page> </notebook> </group></group> </sheet> </form> </field> </record>

<record id="action_warranty_warranty" model="ir.actions.act_window"> <field name="name">Warranty Details</field> <field name="res_model">warranty.warranty</field> <field name="view_type">form</field> <field name="view_mode">tree,form</field> </record>

<menuitem id="warranty_parent" name="Warranty"/> <menuitem id="menu_warranty_parent" name="Warranty Management" parent="warranty_parent"></menuitem> <menuitem action="action_warranty_warranty" id="menu_warranty_warranty" parent="menu_warranty_parent" string="Result"/> </data> </openerp>

Try this .xml it will be work.

This seems to be my same code.Is there any change with that of mine?

sneha antony
on 3/5/14, 7:30 AM

I tried with the code which you provided.But the same error appears

sneha antony
on 3/5/14, 7:32 AM

see the terminal, they tell which field is missing. some changes in that code.

sridhar
on 3/5/14, 7:34 AM

I tried with the code you provided.But still the same error is repeating

sneha antony
on 3/5/14, 7:36 AM

now try that

sridhar
on 3/5/14, 7:39 AM

the code you gave?

sneha antony
on 3/5/14, 7:41 AM

i updated the code.

sridhar
on 3/5/14, 7:42 AM

the code which you gave as anwer has been tried.But the error still exists

sneha antony
on 3/5/14, 7:45 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

0 follower(s)

Stats

Asked: 3/5/14, 7:10 AM
Seen: 1279 times
Last updated: 3/16/15, 8:10 AM