Incorrect XML view parsing

Bug #693344 reported by Hery Atmadja
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Low
OpenERP's Framework R&D

Bug Description

When a module is uploaded or updated, putting a comment right after the <field name="arch" type="xml"> results in a parsing error. This bug has been shared with Jay (OpenERP) - Dec 2010.

The resulting tree view is loaded up (incorrectly) as follow:
<?xml version="1.0"?>
<data><!--XXX HERE XXX Editable attribute allows the list view to have a blank row for adding new record. -->
    <tree string="Academies" editable="top" colors="blue:category=='science'">
    <!--Editable attribute allows the list view to have a blank row for adding new record. -->
    <!--colors attribute will highlight the record if the condition is met -->
    <!--Conditions can be a complex (multi field) expression -->
     <field name="name"/>
     <field name="date_estd"/>
     <field name="address_id"/>
     <field name="no_of_employees"/>
     <field name="rating"/>
     <field name="category"/>
    </tree>
   </data>

Sample view XML file:
 <record id="view_list_academy" model="ir.ui.view">
   <field name="name">List view of Academy</field>
   <!-- model notation is read as follow....the openacademy class (2nd) of openacademy module (1st) -->
   <field name="model">openacademy.openacademy</field>
   <field name="type">tree</field>
   <field name="arch" type="xml">
    <!--XXX HERE XXX Editable attribute allows the list view to have a blank row for adding new record. -->
    <tree string="Academies" editable="top" colors="blue:category=='science'">
    <!--Editable attribute allows the list view to have a blank row for adding new record. -->
    <!--colors attribute will highlight the record if the condition is met -->
    <!--Conditions can be a complex (multi field) expression -->
     <field name="name"/>
     <field name="date_estd"/>
     <field name="address_id"/>
     <field name="no_of_employees"/>
     <field name="rating"/>
     <field name="category"/>
    </tree>
   </field>
 </record>

The resulting error message in GTK client:
Traceback (most recent call last):
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/modules/gui/window/tree.py", line 208, in sig_open
    if not self.sig_action(widget, 'tree_but_open', warning=False):
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/modules/gui/window/tree.py", line 202, in sig_action
    warning=warning)
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/modules/action/main.py", line 199, in exec_keyword
    self._exec_action(action, data, context=context)
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/modules/action/main.py", line 143, in _exec_action
    limit=datas['limit'], auto_refresh=datas['auto_refresh'], auto_search = datas['auto_search'], search_view = datas['search_view'])
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/modules/gui/window/__init__.py", line 49, in create
    auto_refresh=auto_refresh, auto_search=auto_search, search_view=search_view)
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/modules/gui/window/form.py", line 73, in __init__
    show_search=True, window=self.window, limit=limit, readonly=bool(auto_refresh), auto_search=auto_search, search_view=search_view)
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/widget/screen/screen.py", line 129, in __init__
    view = self.add_view_id(view_id, view_type[0], help=help)
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/widget/screen/screen.py", line 604, in add_view_id
    toolbar=view.get('toolbar', False), submenu=view.get('submenu', False), context=context)
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/widget/screen/screen.py", line 645, in add_view
    view = parser.parse(self, root_node, self.fields, toolbar=toolbar, submenu=submenu, help=help)
  File "/home/heryatmadja/workspace/openerp-training/6.0/trunk/openobject-client/bin/widget/view/widget_parse.py", line 53, in parse
    raise Exception(_("This type (%s) is not supported by the GTK client !") % node.tag)
Exception: This type (data) is not supported by the GTK client !

Related branches

description: updated
Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
xrg (xrg) wrote :

Let me take a look at it..

Revision history for this message
xrg (xrg) wrote :

It was an error in the server.

Since the importance of this issue is really low (we never expect to have perfect parsers for the full XML set), we have to see if this patch can be queued for v6.0.0 .

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

This is due to a bew auto-wrapping feature introduce in v6 to allow multiple root elements in the architecture of views, and was not ignoring comments. This has been fixed in revision 3151 <email address hidden>

Thanks for reporting!

Changed in openobject-server:
milestone: none → 6.0-rc2
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.