Skip to Content
Menu
This question has been flagged
3 Replies
5743 Views

Hi, this is my code, as mentioned above. I get the error of Element Odoo has extra content.

Here is my XML code:

id="view_college_students_form" model="ir.ui.view">
name="name">college.students.form
name="model">college.students
name="arch" type="xml">
string="College Students">

string="College Students information">

name="name"/>
name="stu_class"/>


name="address"/>
name="phone_number"/>


name="blood_group"/>
name="dob"/>
name="student_id"/>



string="student academic info">
name="stu_lines_id">
string="Line item">
name="subject"/>
name="mark"/>
name="grade"/>








name="subject"/>
name="grade"/>

name="marks"/>

Can someone review this and solve this?


Avatar
Discard
Best Answer

The error message "Element 'odoo' has extra content: 'string'" is indicating that the 'string' attribute is not valid for the 'odoo' element in your XML code. The 'odoo' element is the root element of an Odoo view, and it does not have a 'string' attribute.

The problem is that you have used the 'string' attribute with the 'odoo' element, which is not valid.

Here is an example of how the 'odoo' element should be used:


You can see that the 'odoo' element has a child element 'data' which contains 'record' and inside the record, you have the fields defined.

I suggest you to review the documentation of the view architecture in odoo and check if the structure you have used is correct or not.

Also, check if the fields you have used in the form are exist in the model 'college.students' or not.

Avatar
Discard
Best Answer

You most likely have an incorrect xml. Read this post: https://www.linkedin.com/pulse/nasty-assertion-error-element-odoo-has-extra-content-malekinejad/. I also had a typo that would have never found. My IDE also didn't highlight it.

Avatar
Discard
Best Answer

I experienced the same recently when i tried to upgrade the views. It has never happened while i run and develop on a Linux platform, but appears when i shifted to a Win10 environment. For your reference,  I tried the following and solved the problem:

1、Strict indentation : make sure very single line correctly and strictly indented , not pressing Tab type but 4 blank spaces;

2、Finish with entire structure :  complete the corresponding view、action、menuitem before upgrading.

Personally i inclined to the 1st issue is the cause.

Avatar
Discard