popup window of one2many field crash if it has context

Bug #513824 reported by ginsmar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Undecided
Sananaz (Open ERP)

Bug Description

Hi!
When you click in a row of a one2many field, the popup window doesn't appear, and the web client get the next error:
(If you are in editing mode, the popup window works well !!)

[28/Jan/2010:15:34:46] HTTP Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/_cprequest.py", line 606, in respond
    cherrypy.response.body = self.handler()
  File "/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/_cpdispatch.py", line 25, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-5.0.7-py2.6.egg/openerp/controllers/base.py", line 130, in wrapper
    return fn(*args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-5.0.7-py2.6.egg/openerp/tools/expose.py", line 204, in func_wrapper
    res = func(*args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-5.0.7-py2.6.egg/openerp/controllers/search.py", line 154, in eval_domain_and_context
    context = tools.expr_eval(context, ctx)
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-5.0.7-py2.6.egg/openerp/tools/tools.py", line 43, in expr_eval
    return eval(string, context)
  File "<string>", line 1, in <module>
NameError: name 'alias' is not defined

I write an example:

=============================================
class test_parent(osv.osv):
    _name = 'test_parent'
    _description = 'Test Parent'

    _columns = {
        'name': fields.char('Parent Name', size=64, required=True, select=True),
        'alias': fields.char('alias', size=64),
        'child_ids': fields.one2many('test.child', 'parent_id', 'Childs'),
    }

test_parent()

class test_child(osv.osv):
    _name = 'test.child'
    _description = 'Test Child'

    _columns = {
        'name': fields.char('Child Name', size=64, required=True, select=True, translate=True),
        'alias': fields.char('alias', size=64),
        'parent_id': fields.many2one('test_parent', 'Parent'),
    }

test_child()

=============================================

        <record id="view_test_parent_form" model="ir.ui.view">
            <field name="name">test_parent.form</field>
            <field name="model">test_parent</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Test Data">
                    <field name="name"/>
                    <newline/>
                    <field name="alias"/>
                    <newline/>
                    <field name="child_ids" context="{'alias':alias}"/>
                    <newline/>
                </form>
            </field>
        </record>

        <record id="action_test_parent_tree" model="ir.actions.act_window">
            <field name="name">Test parent</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">test_parent</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>
        <menuitem id="menu_test_parent_tree" action="action_test_parent_tree" parent="menu_test_root"/>

Related branches

Revision history for this message
ginsmar (ginsmar) wrote :
Navrang Oza (noz-tiny)
Changed in openobject-client-web:
assignee: nobody → Jra (Open ERP) (jra-openerp)
Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello,

Its fixed in stable. Please update your code and notify us.

Revision-Info:
2809 <email address hidden>

Thanks.

Changed in openobject-client-web:
status: New → Fix Committed
Changed in openobject-client-web:
assignee: Jra (Open ERP) (jra-openerp) → sma (Open ERP) (sma-tiny)
milestone: none → 5.0.11
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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