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

New Module Error: Invalid XML for View Architecture!

By
kim
on 5/30/13, 5:33 AM 3,845 views

Hi all, I was trying to create a testing module for OpenERP 7 but after i done and want to install it. it show the error message "Error occurred while validating the field(s) arch: Invalid XML for View Architecture!"

Can i know what is the problem with my XML file i checked is no problem. below is my script

1

Ghanshyam Prajapati

--Ghanshyam Prajapati--
1377
| 4 4 8
Pune, India
--Ghanshyam Prajapati--
OpenERP Developer
Ghanshyam Prajapati
On 5/30/13, 6:18 AM

remove: <field name="type">form</field> from student_info_view.xml file replace : <form string="Student result"> with <form string="Student result" version="7.0">

Hope it works for you.

replace following with:

<record model="ir.ui.view" id="student_search">
    <field name="name">student.search</field>
    <field name="model">student.student</field>
    <field name="arch" type="xml">
        <search string="Student Information Sarch">
            <field name="name" string="Student Name" />
            <field name="gender" string="Gender" />
            <field name="age" string="Age" />
        </search>
    </field>
</record>

<record id="student_student_tree" model="ir.ui.view">
    <field name="name">student.result.tree</field>
    <field name="model">student.student</field>
    <field name="arch" type="xml">
        <tree string="Student_result">
            <field name="name" />
            <field name="age" />
            <field name="percentage" />
            <field name="gender" />
            <field name="active" />
        </tree>
    </field>
</record>

<record id="student_student_form" model="ir.ui.view">
    <field name="name">student.result.form</field>
    <field name="model">student.student</field>
    <field name="arch" type="xml">
        <form string="Student result" version="7.0">
            <field name="name" />
            <field name="age" />
            <field name="percentage" />
            <field name="gender" />
            <field name="active" />
            <field name="notes" />
        </form>
    </field>
</record>

tested delete but still the same

kim
on 5/30/13, 6:42 AM

Hey kim, please see my updated answer. hope it works for you

Ghanshyam Prajapati
on 5/30/13, 6:51 AM

Hi Ghanshyam, i had replaces your code still the same. T_T

kim
on 5/30/13, 7:02 AM

Hey kim, i watched your code and i saw one error of semicolon here, in your student_info.py file, i can see class student_student(osv,osv): which is wrong, replace it with class student_student(osv.osv):

Ghanshyam Prajapati
on 5/30/13, 7:09 AM

Hi Ghanshyam i had changed and also i found 1 more error "from osv import osv.fields" should be "from osv import osv,fields" and after i replace this 2 error still get the same error.

kim
on 5/30/13, 7:27 AM

replace 'from osv import osv,fields' with 'from openerp.osv import osv, fields'

Ghanshyam Prajapati
on 5/30/13, 7:59 AM
1
kim
On 5/30/13, 5:35 AM

__init__.py

import student_info

__openerp__.py

{

'name': 'Testing',
'version': '1.0',
'category': 'A Module of Testing',
'description': """
 Testing 
 Testing
""",
'author': 'Test',
'depends': ['base'],
'website': 'http://www.test.com',
'update_xml': ['student_info_view.xml'],
'installable': True,
'active': False,

}

student_info.py

from osv import osv.fields

class student_student(osv,osv):

  _name = 'student.student'
  _columns = {

              'name': fields.char('Student Name',size=16, required = True, translate = True),
              'age': fields.integer('Age', readonly = True),
              'percent': fields.float('Percentage',help = 'This field will add average marks of student out of 100.'),
              'gender': fields.selection([('male','Male'),('female','Female')],'Gender'),
              'active' : fields.boolean('Active'),
              'notes' : fields.text('Details')
             }
  _defaults = {
                'name' : 'Atul',
                'active' : True
              }

student_student()

student_info_view.xml

<openerp> <data>

<!-- Student Search View -->
    <record model="ir.ui.view" id="student_search">
        <field name="name">student.search</field>
        <field name="model">student.student</field>
        <field name="type">search</field>
        <field name="arch" type="xml">
        <search string="Student Information Sarch">
            <field name="name" string="Student Name" />
            <field name="gender" string="Gender" />
            <field name="age" string="Age" />
        </search>
        </field>
    </record>

<!-- Student Tree View -->
    <record id="student_student_tree" model="ir.ui.view">
        <field name="name">student.result.tree</field>
        <field name="model">student.student</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
        <tree string="Student_result">
            <field name="name" />
            <field name="age" />
            <field name="percentage" />
            <field name="gender" />
            <field name="active" />
        </tree>
        </field>
    </record>

<!-- Student Form View -->
    <record id="student_student_form" model="ir.ui.view">
        <field name="name">student.result.form</field>
        <field name="model">student.student</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
        <form string="Student result">
            <field name="name" />
            <field name="age" />
            <field name="percentage" />
            <field name="gender" />
            <field name="active" />
            <field name="notes" />
        </form>
        </field>
    </record>

<!-- Student Action -->
    <record id="action_student_student" model="ir.actions.act_window">
        <field name="name">Student Information</field>
        <field name="res_model">student.student</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
    </record>



<!-- Student Menu -->
    <menuitem id="student_parent" name="Student" icon="terp-partner" />
    <menuitem id="menu_student_parent" name="Student Management" parent="student_parent" />
    <menuitem action="action_student_student" id="menu_student_student" parent="menu_student_parent" string="Result" />

</data>

</openerp>

replace "from osv import osv.fields" with "from openerp.osv import osv, fields".

Ghanshyam Prajapati
on 5/30/13, 8:10 AM
0
Maath
On 5/30/13, 6:19 AM

Hi,

It seem correct

see http://mirnauman.wordpress.com/2010/09/02/openerp-module-development-part-1/

just change __terp__.py to __openerp__.py

Regards

0

Andreas Maertens

--Andreas Maertens--
912
| 5 5 7
Finsterwalde, Germany
--Andreas Maertens--

I develop odoo8.0 modules

Andreas Maertens
On 5/30/13, 6:21 AM

Try:

  1. remove <field name="view_type"> tag from the views. That is depricated.

  2. Add version="7.0" to tree, search and form tag in the view. e.g. <form string="Student Result" version="7.0">

If this doesn't help please come back and we take a closer look on the code.

removed and add the version still the same error message

kim
on 5/30/13, 6:44 AM
0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 5/30/13, 8:47 AM

Hello Kim,

You need to change the following:

In your student_info.py file,

Instead of

from osv import osv.fields

class student_student(osv,osv):

write

from osv import osv,fields

class student_student(osv.osv):

& In student_info_view.xml file,

In tree and form view instead of

<field name="percentage" />

write

<field name="percent" />

Thank you.

Hi thanks you i guess is the problem <field name="percentage" /> Thanks all lot.....

kim
on 5/30/13, 11:50 PM

I too installed the same module in my openerp 7 and it worked perfectly well for me.The only issue is the field labels of the fields are not showing in the create option

sneha antony
on 2/28/14, 6:37 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: 5/30/13, 5:33 AM
Seen: 3845 times
Last updated: 3/16/15, 8:10 AM