Comments at toplevel of member overloads in an inherited view blow up

Bug #494969 reported by Xavier (Open ERP)
6
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

In an inherited view e.g.

 <record id="my_config_view_form" model="ir.ui.view">
      <field name="name">my.item.config.view</field>
      <field name="model">my.model.config</field>
      <field name="type">form</field>
      <field name="inherit_id" ref="base.some_base_view"/>
      <field name="arch" type="xml">
        <data>
          <!-- this is my comment -->
          <field name="foo" position="replace"/>
        </data>
      </field>

    </record>

the presence of the comment will cause the matching to break down with the following trace:

[2009-12-10 11:36:20,372] ERROR:web-services:[12]: Traceback (most recent call last):
[2009-12-10 11:36:20,372] ERROR:web-services:[13]: File "lib/python2.6/site-packages/openerp-server/osv/osv.py", line 60, in wrapper
[2009-12-10 11:36:20,372] ERROR:web-services:[14]: return f(self, dbname, *args, **kwargs)
[2009-12-10 11:36:20,372] ERROR:web-services:[15]: File "lib/python2.6/site-packages/openerp-server/osv/osv.py", line 119, in execute
[2009-12-10 11:36:20,373] ERROR:web-services:[16]: res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2009-12-10 11:36:20,373] ERROR:web-services:[17]: File "lib/python2.6/site-packages/openerp-server/osv/osv.py", line 111, in execute_cr
[2009-12-10 11:36:20,373] ERROR:web-services:[18]: return getattr(object, method)(cr, uid, *args, **kw)
[2009-12-10 11:36:20,373] ERROR:web-services:[19]: File "lib/python2.6/site-packages/openerp-server/osv/orm.py", line 1356, in fields_view_get
[2009-12-10 11:36:20,373] ERROR:web-services:[20]: result['arch'] = _inherit_apply_rec(inherit_result, sql_res[3])
[2009-12-10 11:36:20,373] ERROR:web-services:[21]: File "lib/python2.6/site-packages/openerp-server/osv/orm.py", line 1351, in _inherit_apply_rec
[2009-12-10 11:36:20,373] ERROR:web-services:[22]: result = _inherit_apply(result, inherit)
[2009-12-10 11:36:20,373] ERROR:web-services:[23]: File "lib/python2.6/site-packages/openerp-server/osv/orm.py", line 1290, in _inherit_apply
[2009-12-10 11:36:20,373] ERROR:web-services:[24]: raise AttributeError(_("Couldn't find tag '%s' in parent view !") % tag)
[2009-12-10 11:36:20,374] ERROR:web-services:[25]: AttributeError: Couldn't find tag '<<built-in function Comment>>' in parent view !

The inheritance handler should only consider actual elements, not look for (and try to replace) comments.

Related branches

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
status: New → Confirmed
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Fix landed in revision 3126 <email address hidden>
Thanks!

Changed in openobject-server:
status: Confirmed → Fix Released
milestone: none → 6.0-rc2
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.