This question has been flagged
10 Replies
71952 Views

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
Avatar
Discard
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,

Avatar
Discard

Hi, it should works fine with current tags

thanks Mehtha i had the same error and this answer worked

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.

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  

Avatar
Discard
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.

Avatar
Discard
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=""/>
Avatar
Discard
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 ...
Avatar
Discard
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>


Avatar
Discard

Try with my updated code.

Best Answer

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

Thanks..

Avatar
Discard
Best Answer

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

Avatar
Discard