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

arch: Invalid XML for View Architecture!'

By
bala
on 1/30/14, 2:31 AM 1,418 views

I get following error while I login openerp.

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

xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- ===================== This is tree layout =============================-->
<record id="lis_tree" model="ir.ui.view">
        <field name="name">Lab Registration</field>
        <field name="model">lis.lab</field>
        <field name="arch" type="xml">
            <tree string="lab">
                <field name = "name"/>
                <field name = "customer_email"/>
                <field name = "customer_name"/>
                <field name = "customer_city"/>
                <field name = "customer_mobile"/>
            </tree>
        </field>
    </record>

<!-- ========================This is Form layout===============================-->
<record id="lis_form" model="ir.ui.view">
        <field name="name">Lab Registration</field>
        <field name="model">lis.lab</field>
        <field name="arch" type="xml">
            <form string="lab" version="7.0">
                <sheet>
                    <group>
                        <field name = "name"/>
                        <field name = "customer_name" on_change="on_change_customer(customer_name)"/>
                        <field name = "customer_city"/>
                        <field name = "customer_email"/>
                        <field name = "customer_mobile"/>    
                    </group>
               </sheet>
            </form>
       </field>
    </record>

<!-- ========================= Action Layout ============================= -->
    <record id="action_lab" model="ir.actions.act_window">
        <field name="name">Lab Registration</field>
        <field name="type">ir.actions.act_window</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="view_id" ref="lis_tree"/>
    </record>

    <!-- ===================== This is tree layout =============================-->
<record id="test_tree" model="ir.ui.view">
        <field name="name">Test Report</field>
        <field name="model">lis.lab</field>
        <field name="arch" type="xml">
            <tree string="test">
                <field name = "name"/>
                <field name = "customer_email"/>
            </tree>
        </field>
    </record>

<!-- ========================This is Form layout===============================-->
<record id="test_form" model="ir.ui.view">
        <field name="name">Test Report</field>
        <field name="model">lis.lab</field>
        <field name="inherit_id" ref="lis_form"/>
        <field name="arch" type="xml">
            <form string="test" version="7.0">
                <sheet>
                    <group>
                        <field name="lab_id" on_change="on_change_labid(lab_id)"/>
                    </group>
                    <notebook> 
                        <page string="Hemothalaogy">
                            <group colspan="2">
                                <group>
                                    <field name="tot_vol"/>
                                    <field name="cd45"/>
                                </group>
                                <group>
                                    <field name="tncpre" class="oe_inline" />
                                    <field name="tncpost"/>
                                    <field name="cd34"/>
                                </group>
                            </group>
                        </page>
                        <page string="Serology">

                        </page>
                    </notebook>
                </sheet>
            </form>
       </field>
    </record>

<!-- ========================= Action Layout ============================= -->
    <record id="action_test" model="ir.actions.act_window">
        <field name="name">Test Report</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">lis.lab</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="view_id" ref="test_tree"/>
    </record>

    <!-- ===========================Menu Settings=========================== -->
    <menuitem name = "LIS" id = "menu_lis_lab" />
        <menuitem name = "Lab Info" id = "menu_sub" parent = "menu_lis_lab"/>
            <menuitem name = "Lab Registration" id = "lab_register" parent = "menu_sub" action = "action_lab" />
            <menuitem name = "Test Report" id = "lab_test" parent = "menu_sub" action = "action_test" />

</data>
</openerp>

python

from osv import osv
from osv import fields

class cus(osv.osv):
 _name = "lis.lab"
 _description = "This table is for keeping lab data of cord blood"
 _columns = {
    'name': fields.char('Lab Id',size=20,required=True),
    'customer_name': fields.many2one('res.partner', 'Customer Name', domain=[('customer', '=', True)]),
    'customer_city': fields.char('City', size=20),
    'customer_email': fields.char('Email', size=20),
    'customer_mobile': fields.char('Mobile', size=20)
 }
 def on_change_customer(self, cr, uid, ids, customer_name, context=None):
  values = {}
  if customer_name:
   cust = self.pool.get('res.partner').browse(cr, uid, customer_name, context=context)
   values = {
    'customer_city': cust.city,
    'customer_email': cust.email,
    'customer_mobile': cust.mobile
   }
  return {'value' : values}

class test(osv.osv):
 _inherit = "lis.lab"
 _description = "Lab Result"
 _columns = {
 'lab_id': fields.many2one('lis.lab','Lab Id'),
 'tot_vol': fields.char('Total Volume', size=20),
 'cd45': fields.char('CD45 viability (%)', size=20),
 'tncpre': fields.char('TNC pre (x10 exp 8)', size=20),
 'tncpost': fields.char('TNC post (x10 exp 8)', size=20),
 'cd34': fields.char('Amount CD34+', size=20)
 }
 def on_change_labid(self, cr, uid, ids, name, context=None):
  values = {}
  if name:
   custinfo = self.pool.get('lis.lab').browse(cr, uid, name, context=context)
   values = {
   }
  return {'value' : values}

Check OpenERP's log file (or Eclipse's console if you are using it for debugging), it gives more exact info and usually a good description which part of XML caused the error.

Vizucom Oy, Timo Talvitie
on 1/30/14, 6:43 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: 1/30/14, 2:31 AM
Seen: 1418 times
Last updated: 3/16/15, 8:10 AM