Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

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

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
convertassertionerrorodoo9
10 Réponses
77758 Vues
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
Ignorer
Avatar
Jignesh Mehta
Meilleure réponse

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
Ignorer
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
Meilleure réponse

 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
Ignorer
Avatar
Ankit H Gandhi(AHG)
Meilleure réponse

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
Ignorer
Avatar
G.Abdessamia
Meilleure réponse
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
Ignorer
Avatar
Qutechs, Ahmed M.Elmubarak
Meilleure réponse

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
Ignorer
Avatar
Jeferson M. Moreira
Auteur Meilleure réponse

@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
Ignorer
Jignesh Mehta

Try with my updated code.

Avatar
foram shah
Meilleure réponse

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

Thanks..

0
Avatar
Ignorer
Avatar
ABU K
Meilleure réponse

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

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
AssertionError: Element odoo has extra content: data owing to few lines of code in the Email Template XML
assertionerror
Avatar
Avatar
1
oct. 23
3671
How to get data n view using custom widget in odoo 9
odoo9
Avatar
0
sept. 23
2859
How to get data n view using custom widget in odoo 9
odoo9
Avatar
0
sept. 23
2548
How to Remove " ADD NEW COLUMN " from task kanban view of Project Module? Résolu
odoo9
Avatar
Avatar
Avatar
2
juin 25
12202
How to edit the product website description Résolu
odoo9
Avatar
Avatar
Avatar
Avatar
Avatar
6
oct. 23
23521
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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