Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

AssertionError: Element openerp has extra content: data, line 3

Subscribe

Get notified when there's activity on this post

This question has been flagged
convertassertionerrorodoo9
10 Replies
77731 Views
Avatar
Jeferson M. Moreira

I get the following error while trying to install my custom addon module on odoo 9.0, what should I do to fix this?


Odoo Server Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 680, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 316, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 309, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 959, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 509, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 896, in call_button
    action = self._call_kw(model, method, args, {})
  File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 884, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/base/module/module.py", line 459, in button_immediate_install
    return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/base/module/module.py", line 533, in _button_immediate_function
    registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
  File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 385, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 338, in load_modules
    loaded_modules, update_module)
  File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 237, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 156, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 98, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/usr/lib/python2.7/dist-packages/openerp/tools/convert.py", line 852, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/usr/lib/python2.7/dist-packages/openerp/tools/convert.py", line 926, in convert_xml_import
    relaxng.assert_(doc)
  File "lxml.etree.pyx", line 3375, in lxml.etree._Validator.assert_ (src/lxml/lxml.etree.c:166410)
AssertionError: Element openerp has extra content: data, line 3
2
Avatar
Discard
Avatar
Jignesh Mehta
Best Answer

Hello Jeferson,


In your XMl file, there is an extra tag. So it gives error as extra content. Please Check your XML file.


UPDATE:-

Remove the <data></data> tag and try <odoo></odoo> tag instead of <openerp></openerp> tag.

<?xml version="1.0" encoding="utf-8"?>

<odoo>

     // Your XML File

</odoo>


Thanks,

7
Avatar
Discard
Qutechs, Ahmed M.Elmubarak

Hi, it should works fine with current tags

Mubaris ct

thanks Mehtha i had the same error and this answer worked

Ray Carnes (ray)

Also check that you don't use < or > (like if you want to define a string in your file that is actually an HTML 'a' link) and instead use &lt; and &gt; otherwise the parser will think you are defining tags.

Avatar
rock_solid
Best Answer

 there is not only extra tag can cause the problem,but also some misstyping , open the xml file with IE  and you'll find the extra content easily,then delete it  

1
Avatar
Discard
Avatar
Ankit H Gandhi(AHG)
Best Answer

Hello all,

I facing same issue but I solved out my mistake.

Kindly check xml tag spelling.  It might be code have wrong spelling.

like..

True <menuitem>

wrong <menitem>

True word is sequence

Wrong word is seqence

Hope this help you.

Best Thanks,

Ankit H Gandhi.

0
Avatar
Discard
Avatar
G.Abdessamia
Best Answer
In my case that was just a mistyping of web_icon form a menu, i wrote web-icon instead :
<menuitem id="purchase_menu" name="Achats"
                   web_icon="......."
                   sequence=""/>
0
Avatar
Discard
Avatar
Qutechs, Ahmed M.Elmubarak
Best Answer

Hi,

I think your code has a lot of issues. But I think the one which generated this error is that you're putting the <button> field out side the <tree tag 

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<!-- ORDER VIEW TO LIST EMPLOYEE AND MANAGER ORDERS -->
<record model="ir.ui.view" id="my_order_tree_view">
<field name="name">order.tree</field>
<field name="model">helpdesk.order</field>
<field name="arch" type="xml">
<tree string="My Orders">
<field name="name" domain="['&amp;',('partner_id','=',user.partner_id.id), ('company_id','=',user.partner_id.company_id.id)]"/>
<field name="state" domain="['&amp;',('partner_id','=',user.partner_id.id), ('company_id','=',user.partner_id.company_id.id)]"/>
</tree>
</field>
<button string="New Order" name="%(action_order_form_view)d" type="action"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create the first order</p>
</field>
</record>



Try to remove or comment this line and try again ...
0
Avatar
Discard
Avatar
Jeferson M. Moreira
Author Best Answer

@Dep and @Jignesh I checked my code and I can't find any extra tag or close tag missing. I understand through the log that this problem is because of <data></data>, but this doesn't make sense. Please can someone look at my code and help me.


<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<!-- ORDER VIEW TO LIST EMPLOYEE AND MANAGER ORDERS -->
<record model="ir.ui.view" id="my_order_tree_view">
<field name="name">order.tree</field>
<field name="model">helpdesk.order</field>
<field name="arch" type="xml">
<tree string="My Orders">
<field name="name" domain="['&amp;',('partner_id','=',user.partner_id.id), ('company_id','=',user.partner_id.company_id.id)]"/>
<field name="state" domain="['&amp;',('partner_id','=',user.partner_id.id), ('company_id','=',user.partner_id.company_id.id)]"/>
</tree>
</field>
<button string="New Order" name="%(action_order_form_view)d" type="action"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create the first order</p>
</field>
</record>

<record model="ir.actions.act_window.view" id="action_my_order_tree_view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="my_order_tree_view"/>
<field name="act_window_id" ref="action_my_order_tree_view"/>
</record>

<!-- ORDER VIEW TO LIST ALL ORDERS FROM A SPECIFIC COMPANY -->
<record model="ir.ui.view" id="company_order_tree_view">
<field name="name">order.tree</field>
<field name="model">helpdesk.order</field>
<field name="arch" type="xml">
<tree string="Orders">
<field name="name" domain="[('company_id','=',user.partner_id.company_id.id)]"/>
<field name="state" domain="[('company_id','=',user.partner_id.company_id.id)]"/>
</tree>
</field>
<button string="New Order" name="%(action_order_form_view)d" type="action"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create the first order</p>
</field>
</record>

<record model="ir.actions.act_window.view" id="action_company_order_tree_view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="company_order_tree_view"/>
<field name="act_window_id" ref="action_company_order_tree_view"/>
</record>

<!-- ORDER VIEW TO LIST TRACKED ORDERS TO AGENT -->
<record model="ir.ui.view" id="tracked_order_tree_view">
<field name="name">order.tree</field>
<field name="model">helpdesk.track.follow</field>
<field name="arch" typ="xml">
<tree string="Tracked Orders">
<field name="name" domain="[('user_id','=',user.id)]"/>
<field name="state" domain="[('user_id','=',user.id)]"/>
</tree>
</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Track the first order</p>
</field>
</record>

<record model="ir.actions.act_window.view" id="action_tracked_order_tree_view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="tracked_order_tree_view"/>
<field name="act_window_id" ref="action_tracked_order_tree_view"/>
</record>

<!-- ORDER VIEW TO LIST OPEN ORDERS TO AGENT -->
<record model="ir.ui.view" id="open_order_tree_view">
<field name="name">order.tree</field>
<field name="model">helpdesk.order</field>
<field name="arch" typ="xml">
<tree string="Open Orders">
<field name="name" domain="[('state','=','open')]"/>
<field name="state" domain="[('state','=','open')]"/>
</tree>
</field>
</record>

<record model="ir.actions.act_window.view" id="action_open_order_tree_view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="open_order_tree_view"/>
<field name="act_window_id" ref="action_open_order_tree_view"/>
</record>

<!-- ORDER VIEW TO LIST ALL ORDERS -->
<record model="ir.ui.view" id="orders_tree_view">
<field name="name">order.tree</field>
<field name="model">helpdesk.order</field>
<field name="arch" typ="xml">
<tree string="Orders">
<field name="name"/>
<field name="state"/>
</tree>
</field>
</record>

<record model="ir.actions.act_window.view" id="action_orders_tree_view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="orders_tree_view"/>
<field name="act_window_id" ref="action_orders_tree_view"/>
</record>

<!-- ANSWER ORDER FORM VIEW -->
<record model="ir.ui.view" id="order_form_view">
<field name="name">order.form</field>
<field name="model">helpdesk.answer</field>
<field name="arch" type="xml">
<form string="Order Form">
<header>
<button name="action_open" type="object" groups="employee,company_manager" string="Open" states="open" class="oe_highlight"/>
<button name="action_solved" type="object" groups="employee,company_manager" string="Solved" states="solved" class="oe_highlight"/>
<button name="action_deleted" type="object" groups="company_manager" string="Delete" states="deleted" class="oe_highlight"/>
<button name="action_message" type="object" string="Send message" class="oe_highlight"/>
<button name="action_track" type="object" groups="agents" string="Track" states="tracked" class="oe_highlight" attrs="{'invisible:[('state','=','tracked')]'}"/>
<button name="action_assign" type="object" groups="helpdesk_manager" string="Assign" states="tracked" class="oe_highlight" attrs="{'invisible:[('state','=','tracked')]'}"/>
<field name="state" widget="statusbar"/>
</header>

<sheet>
<group>
<field name="name"/>
<field name="description"/>
<field name="message"/>
</group>
</sheet>
</form>
</field>
</record>

<record model="ir.actions.act_window" id="action_order_form_view">
<field name="name">Order</field>
<field name="res_model">helpdesk.order</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>

<!-- MENU -->
<!-- top level menu: no parent -->
<menuitem id="main_helpdesk_menu" name="HelpDesk"/>

<!-- A first level in the left side menu is needed before using action= attribute -->
<menuitem id="helpdesk_menu" name="HelpDesk" parent="main_helpdesk_menu"/>

<!-- Submenu -->
<menuitem id="my_order_menu" name="My Orders" groups="employee,company_manager" parent="helpdesk_menu" action="action_my_order_tree_view"/>
<menuitem id="company_order_menu" name="Company Orders" groups="company_manager" parent="helpdesk_menu" action="action_company_order_tree_view"/>
<menuitem id="tracked_order_menu" name="Tracked Orders" groups="agents" parent="helpdesk_menu" action="action_tracked_order_tree_view"/>
<menuitem id="open_order_menu" name="Open Orders" groups="agents" parent="helpdesk_menu" action="action_open_order_tree_view"/>
<menuitem id="all_orders_menu" name="All Orders" groups="helpdesk_manager" parent="helpdesk_menu" action="action_orders_tree_view"/>

</data>
</openerp>


0
Avatar
Discard
Jignesh Mehta

Try with my updated code.

Avatar
foram shah
Best Answer

I got the same error and it is due to miss placing tag <record> instead of <act_window>

Thanks..

0
Avatar
Discard
Avatar
ABU K
Best Answer

somewhere you missed to close />  tag (closing tag ) ,add this  or please paste your xml file 

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
AssertionError: Element odoo has extra content: data owing to few lines of code in the Email Template XML
assertionerror
Avatar
Avatar
1
Oct 23
3633
How to get data n view using custom widget in odoo 9
odoo9
Avatar
0
Sep 23
2831
How to get data n view using custom widget in odoo 9
odoo9
Avatar
0
Sep 23
2529
How to Remove " ADD NEW COLUMN " from task kanban view of Project Module? Solved
odoo9
Avatar
Avatar
Avatar
2
Jun 25
12171
How to edit the product website description Solved
odoo9
Avatar
Avatar
Avatar
Avatar
Avatar
6
Oct 23
23484
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now