← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 499099] Re: bug in one2many in nested record creation

 

Hello,

I think this bug is not totaly fixed !
I have a similar problem with my view.

I have four models nested with one2many, like this:

model1._columns = { ..., 'model2_ids' : fields.one2many('model2',  'model1_id', ...
class mymod_model1 (osv.osv):
    _name ='mymod.model1'
    _columns = {
        'field1': fields.char('Field1',          size=256, required=True),
        ...,
        'model2_ids': fields.one2many('mymod.model2', 'model1_id', 'Models 2')
    }

class mymod_model2 (osv.osv):
    _name ='mymod.model2'
    _columns = {
        'model1_id': fields.many2one('mymod.model1', 'Model 1'),
        ...,
        'model3_ids': fields.one2many('mymod.model3', 'model2_id', 'Models 3')
    }


class mymod_model3 (osv.osv):
    _name ='mymod.model3'
    _columns = {
        'model2_id': fields.many2one('mymod.model2', 'Model 2'),
        ...,
        'model4_ids': fields.one2many('mymod.model4', 'model3_id', 'Models 4')
    }

class mymod_model4 (osv.osv):
    _name ='mymod.model4'
    _columns = {
        'model3_id': fields.many2one('mymod.model3', 'Model 3'),
        ...
    }

I have the corresponding views.
When I test in the GTK Client, there is no problem, but there is one with the Web Interface.

Until model 3, no problem, but when i try to insert a new entry into model4, an exception occur.
I first try with an editable tree, then by using a form. For a few seconds, I believe that the problem was only with the editable tree, but when I click on the save button, I get the error because the tree cannot be update (or something like that !).


The error:

<type 'exceptions.IndexError'>	Python 2.6.6: /usr/bin/python2.6
Mon May 30 13:07:16 2011
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
 /usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/_cprequest.py in respond(self=<cherrypy._cprequest.Request object>, path_info='/openerp/listgrid/get')
  604                     if self.handler:
  605                         self.stage = 'handler'
  606                         cherrypy.response.body = self.handler()
  607                     
  608                     self.stage = 'before_finalize'
global cherrypy = <module 'cherrypy' from '/usr/local/lib/python2..../CherryPy-3.1.2-py2.6.egg/cherrypy/__init__.pyc'>, cherrypy.response = <cherrypy._ThreadLocalProxy object>, cherrypy.response.body = [], self = <cherrypy._cprequest.Request object>, self.handler = <cherrypy._cpdispatch.LateParamPageHandler object>
 /usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/_cpdispatch.py in __call__(self=<cherrypy._cpdispatch.LateParamPageHandler object>)
   23     def __call__(self):
   24         try:
   25             return self.callable(*self.args, **self.kwargs)
   26         except TypeError, x:
   27             test_callable_spec(self.callable, self.args, self.kwargs)
self = <cherrypy._cpdispatch.LateParamPageHandler object>, self.callable = <bound method Root.default of <openobject.controllers._root.Root object>>, self.args = ('openerp', 'listgrid', 'get'), self.kwargs = {'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...}
 /home/yves/Projets/openerp-web-6.0.2/openobject/tools/_expose.py in func_wrapper(*args=(<openobject.controllers._root.Root object>, 'openerp', 'listgrid', 'get'), **kw={'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...})
  180                 raise cherrypy.HTTPError(405)
  181 
  182             res = func(*args, **kw)
  183             if format == 'json' or (allow_json and 'allow_json' in cherrypy.request.params):
  184                 cherrypy.response.headers['Content-Type'] = 'text/javascript'
global res = '/home/yves/Projets/openerp-web-6.0.2/addons/view_graph/widgets/templates/graph.mako', func = <function default>, args = (<openobject.controllers._root.Root object>, 'openerp', 'listgrid', 'get'), kw = {'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...}
 /home/yves/Projets/openerp-web-6.0.2/openobject/controllers/_root.py in default(self=<openobject.controllers._root.Root object>, *args=('openerp', 'listgrid', 'get'), **kw={'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...})
   85             request.handler = cherrypy.NotFound()
   86 
   87         return request.handler()
   88 
   89     def find_handler(self):
request = <cherrypy._ThreadLocalProxy object>, request.handler = <cherrypy._cpdispatch.LateParamPageHandler object>
 /usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/_cpdispatch.py in __call__(self=<cherrypy._cpdispatch.LateParamPageHandler object>)
   23     def __call__(self):
   24         try:
   25             return self.callable(*self.args, **self.kwargs)
   26         except TypeError, x:
   27             test_callable_spec(self.callable, self.args, self.kwargs)
self = <cherrypy._cpdispatch.LateParamPageHandler object>, self.callable = <function get>, self.args = (), self.kwargs = {'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...}
 /home/yves/Projets/openerp-web-6.0.2/addons/openerp/controllers/utils.py in wrapper(*args=(), **kw={'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...})
  110             # User is logged in; allow access
  111             clear_login_fields(kw)
  112             return fn(*args, **kw)
  113         else:
  114             action = kw.get('login_action', '')
fn = <bound method List.get of <openerp.controllers.listgrid.List object>>, args = (), kw = {'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...}
 /home/yves/Projets/openerp-web-6.0.2/openobject/tools/_expose.py in func_wrapper(*args=(<openerp.controllers.listgrid.List object>,), **kw={'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...})
  180                 raise cherrypy.HTTPError(405)
  181 
  182             res = func(*args, **kw)
  183             if format == 'json' or (allow_json and 'allow_json' in cherrypy.request.params):
  184                 cherrypy.response.headers['Content-Type'] = 'text/javascript'
global res = '/home/yves/Projets/openerp-web-6.0.2/addons/view_graph/widgets/templates/graph.mako', func = <function get>, args = (<openerp.controllers.listgrid.List object>,), kw = {'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...}
 /home/yves/Projets/openerp-web-6.0.2/addons/openerp/controllers/listgrid.py in get(self=<openerp.controllers.listgrid.List object>, **kw={'_terp_concurrency_info': 'null', '_terp_context': "{'lang': u'fr_BE', 'tz': False, 'active_model': ...t': 'web', 'active_ids': [100], 'active_id': 100}", '_terp_count': '50', '_terp_domain': '[]', '_terp_edit_inline': '-1', '_terp_editable': 'True', '_terp_filter_domain': '[]', '_terp_filters_context': '', '_terp_group_by_ctx': '[]', '_terp_id': '4', ...})
  283             wid = frm.screen.widget
  284         else:
  285             wid = frm.screen.get_widgets_by_name(source, kind=listgrid.List)[0]
  286 
  287         ids = wid.ids
wid undefined, frm = ViewForm, frm.screen = Screen, frm.screen.get_widgets_by_name = <bound method Screen.get_widgets_by_name of Screen>, source = 'animaux/soins/sorties', kind undefined, global listgrid = <module 'openerp.widgets.listgrid' from '/home/y...p-web-6.0.2/addons/openerp/widgets/listgrid.pyc'>, listgrid.List = <class 'openerp.widgets.listgrid.List'>
<type 'exceptions.IndexError'>: list index out of range 
      args = ('list index out of range',) 
      message = 'list index out of range'

Thank you for your responses.

I apologize if my English isn't perfect, I hope you understant what I
wanted to said

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/499099

Title:
  bug in one2many in nested record creation

Status in OpenERP Web Client:
  Fix Released

Bug description:
  When i insert a new record clicking on his icon on a tree views in a one2many field that is inside another one2many field, i have the following error:
   
  <type 'exceptions.IndexError'>	Python 2.5.2: /usr/bin/python
  Thu Nov 26 09:52:32 2009

  A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
   /usr/lib/python2.5/site-packages/CherryPy-3.1.2-py2.5.egg/cherrypy/_cprequest.py in respond(self=<cherrypy._cprequest.Request object at 0x266fdd0>, path_info='/openo2m/edit')
    604                     if self.handler:
    605                         self.stage = 'handler'
    606                         cherrypy.response.body = self.handler()
    607                     
    608                     self.stage = 'before_finalize'
  global cherrypy = <module 'cherrypy' from '/usr/lib/python2.5/site.../CherryPy-3.1.2-py2.5.egg/cherrypy/__init__.pyc'>, cherrypy.response = <cherrypy._ThreadLocalProxy object at 0xbaa890>, cherrypy.response.body = [], self = <cherrypy._cprequest.Request object at 0x266fdd0>, self.handler = <cherrypy._cpdispatch.LateParamPageHandler object at 0x1952b50>
   /usr/lib/python2.5/site-packages/CherryPy-3.1.2-py2.5.egg/cherrypy/_cpdispatch.py in __call__(self=<cherrypy._cpdispatch.LateParamPageHandler object at 0x1952b50>)
     23     def __call__(self):
     24         try:
     25             return self.callable(*self.args, **self.kwargs)
     26         except TypeError, x:
     27             test_callable_spec(self.callable, self.args, self.kwargs)
  self = <cherrypy._cpdispatch.LateParamPageHandler object at 0x1952b50>, self.callable = <function edit at 0x1fc0320>, self.args = (), self.kwargs = {'_terp_editable': '1', '_terp_o2m': 'address_ids/contact_ids', '_terp_o2m_model': 'spr.parreg.contact', '_terp_parent_context': '{}', '_terp_parent_id': '396', '_terp_parent_model': 'spr.parreg.address', '_terp_parent_view_id': 'False', '_terp_view_params/_terp_model': 'spr.parreg.associate', '_terp_view_params/_terp_view_ids': '[False, False]', '_terp_view_params/_terp_view_mode': "[u'tree', u'form']", ...}
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/controllers/base.py in wrapper(*args=(), **kw={'_terp_editable': '1', '_terp_o2m': 'address_ids/contact_ids', '_terp_o2m_model': 'spr.parreg.contact', '_terp_parent_context': '{}', '_terp_parent_id': '396', '_terp_parent_model': 'spr.parreg.address', '_terp_parent_view_id': 'False', '_terp_view_params/_terp_model': 'spr.parreg.associate', '_terp_view_params/_terp_view_ids': '[False, False]', '_terp_view_params/_terp_view_mode': "[u'tree', u'form']", ...})
    120             # User is logged in; allow access
    121             clear_login_fields(kw)
    122             return fn(*args, **kw)
    123         else:
    124             # User isn't logged in yet.
  fn = <bound method OpenO2M.edit of <openerp.controllers.openo2m.OpenO2M object at 0x186ee50>>, args = (), kw = {'_terp_editable': '1', '_terp_o2m': 'address_ids/contact_ids', '_terp_o2m_model': 'spr.parreg.contact', '_terp_parent_context': '{}', '_terp_parent_id': '396', '_terp_parent_model': 'spr.parreg.address', '_terp_parent_view_id': 'False', '_terp_view_params/_terp_model': 'spr.parreg.associate', '_terp_view_params/_terp_view_ids': '[False, False]', '_terp_view_params/_terp_view_mode': "[u'tree', u'form']", ...}
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/tools/expose.py in func_wrapper(*args=(<openerp.controllers.openo2m.OpenO2M object at 0x186ee50>,), **kw={'_terp_editable': '1', '_terp_o2m': 'address_ids/contact_ids', '_terp_o2m_model': 'spr.parreg.contact', '_terp_parent_context': '{}', '_terp_parent_id': '396', '_terp_parent_model': 'spr.parreg.address', '_terp_parent_view_id': 'False', '_terp_view_params/_terp_model': 'spr.parreg.associate', '_terp_view_params/_terp_view_ids': '[False, False]', '_terp_view_params/_terp_view_mode': "[u'tree', u'form']", ...})
    202         def func_wrapper(*args, **kw):
    203 
    204             res = func(*args, **kw)
    205             
    206             if format == 'json' or (allow_json and 'allow_json' in cherrypy.request.params):
  global res = '/usr/lib/python2.5/site-packages/openerp_web-5.0....egg/openerp/widgets_search/templates/search.mako', func = <function edit at 0x1594758>, args = (<openerp.controllers.openo2m.OpenO2M object at 0x186ee50>,), kw = {'_terp_editable': '1', '_terp_o2m': 'address_ids/contact_ids', '_terp_o2m_model': 'spr.parreg.contact', '_terp_parent_context': '{}', '_terp_parent_id': '396', '_terp_parent_model': 'spr.parreg.address', '_terp_parent_view_id': 'False', '_terp_view_params/_terp_model': 'spr.parreg.associate', '_terp_view_params/_terp_view_ids': '[False, False]', '_terp_view_params/_terp_view_mode': "[u'tree', u'form']", ...}
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/controllers/openo2m.py in edit(self=<openerp.controllers.openo2m.OpenO2M object at 0x186ee50>, **kw={'_terp_editable': '1', '_terp_o2m': 'address_ids/contact_ids', '_terp_o2m_model': 'spr.parreg.contact', '_terp_parent_context': '{}', '_terp_parent_id': '396', '_terp_parent_model': 'spr.parreg.address', '_terp_parent_view_id': 'False', '_terp_view_params/_terp_model': 'spr.parreg.associate', '_terp_view_params/_terp_view_ids': '[False, False]', '_terp_view_params/_terp_view_mode': "[u'tree', u'form']", ...})
    180     def edit(self, **kw):
    181         params, data = TinyDict.split(kw)
    182         return self.create(params)
    183 
    184 # vim: ts=4 sts=4 sw=4 si et
  self = <openerp.controllers.openo2m.OpenO2M object at 0x186ee50>, self.create = <function create at 0x1bf5b18>, params = {'_terp_view_type': 'form', '_terp_o2m': 'addres...'_terp_view_ids': [], '_terp_parent_context': {}}
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/controllers/base.py in wrapper(*args=({'_terp_view_type': 'form', '_terp_o2m': 'addres...'_terp_view_ids': [], '_terp_parent_context': {}},), **kw={})
    120             # User is logged in; allow access
    121             clear_login_fields(kw)
    122             return fn(*args, **kw)
    123         else:
    124             # User isn't logged in yet.
  fn = <bound method OpenO2M.create of <openerp.controllers.openo2m.OpenO2M object at 0x186ee50>>, args = ({'_terp_view_type': 'form', '_terp_o2m': 'addres...'_terp_view_ids': [], '_terp_parent_context': {}},), kw = {}
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/tools/expose.py in func_wrapper(*args=(<openerp.controllers.openo2m.OpenO2M object at 0x186ee50>, {'_terp_view_type': 'form', '_terp_o2m': 'addres...'_terp_view_ids': [], '_terp_parent_context': {}}), **kw={})
    202         def func_wrapper(*args, **kw):
    203 
    204             res = func(*args, **kw)
    205             
    206             if format == 'json' or (allow_json and 'allow_json' in cherrypy.request.params):
  global res = '/usr/lib/python2.5/site-packages/openerp_web-5.0....egg/openerp/widgets_search/templates/search.mako', func = <function create at 0x158db18>, args = (<openerp.controllers.openo2m.OpenO2M object at 0x186ee50>, {'_terp_view_type': 'form', '_terp_o2m': 'addres...'_terp_view_ids': [], '_terp_parent_context': {}}), kw = {}
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/controllers/openo2m.py in create(self=<openerp.controllers.openo2m.OpenO2M object at 0x186ee50>, params={'_terp_view_type': 'form', '_terp_o2m': 'addres...'_terp_view_ids': [], '_terp_parent_context': {}}, tg_errors=None)
    119             form = cherrypy.request.terp_form
    120         else:
    121             form = self.create_form(params, tg_errors)
    122 
    123         return dict(form=form, params=params)
  form undefined, self = <openerp.controllers.openo2m.OpenO2M object at 0x186ee50>, self.create_form = <bound method OpenO2M.create_form of <openerp.controllers.openo2m.OpenO2M object at 0x186ee50>>, params = {'_terp_view_type': 'form', '_terp_o2m': 'addres...'_terp_view_ids': [], '_terp_parent_context': {}}, tg_errors = None
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/controllers/openo2m.py in create_form(self=<openerp.controllers.openo2m.OpenO2M object at 0x186ee50>, params={'_terp_view_type': 'form', '_terp_o2m': 'addres...'_terp_view_ids': [], '_terp_parent_context': {}}, tg_errors=None)
     71         vp.id = params.parent_id or False 
     72         
     73         form = tw.form_view.ViewForm(vp, name="view_form", action="/openo2m/save")
     74         cherrypy.request.terp_validators = {}
     75         wid = form.screen.widget.get_widgets_by_name(params.o2m)[0]
  form undefined, global tw = <module 'openerp.widgets' from '/usr/lib/python2...eb-5.0.6-py2.5.egg/openerp/widgets/__init__.pyc'>, tw.form_view = <module 'openerp.widgets.form_view' from '/usr/l...b-5.0.6-py2.5.egg/openerp/widgets/form_view.pyc'>, tw.form_view.ViewForm = <class 'openerp.widgets.form_view.ViewForm'>, vp = {'_terp_view_type': 'form', 'address_ids': {'_te..._terp_id': 396, '_terp_view_ids': [False, False]}, name undefined, action undefined
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/widgets/base/meta.py in wrapper(self=ViewForm, *args=({'_terp_view_type': 'form', 'address_ids': {'_te..._terp_id': 396, '_terp_view_ids': [False, False]},), **kw={'action': '/openo2m/save', 'name': 'view_form'})
     38             self.__initstack.append(1)
     39 
     40         res = func(self, *args, **kw)
     41         try:
     42             self.__initstack.pop()
  res undefined, func = <function __init__ at 0x1491758>, self = ViewForm, args = ({'_terp_view_type': 'form', 'address_ids': {'_te..._terp_id': 396, '_terp_view_ids': [False, False]},), kw = {'action': '/openo2m/save', 'name': 'view_form'}
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/widgets/form_view.py in __init__(self=ViewForm, params={'_terp_view_type': 'form', 'address_ids': {'_te..._terp_id': 396, '_terp_view_ids': [False, False]}, **kw={'action': '/openo2m/save', 'name': 'view_form'})
     70 
     71         self.screen = Screen(prefix='', hastoolbar=True, editable=editable, readonly=readonly,
     72                              selectable=params.selectable or 2)
     73 
     74         self.sidebar = Sidebar(self.screen.model, self.screen.toolbar, self.screen.id,
  selectable undefined, params = {'_terp_view_type': 'form', 'address_ids': {'_te..._terp_id': 396, '_terp_view_ids': [False, False]}, params.selectable = None
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/widgets/base/meta.py in wrapper(self=Screen, *args=(), **kw={'editable': True, 'hastoolbar': True, 'prefix': '', 'readonly': False, 'selectable': 2})
     38             self.__initstack.append(1)
     39 
     40         res = func(self, *args, **kw)
     41         try:
     42             self.__initstack.pop()
  res undefined, func = <function __init__ at 0x12d5500>, self = Screen, args = (), kw = {'editable': True, 'hastoolbar': True, 'prefix': '', 'readonly': False, 'selectable': 2}
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/widgets/screen.py in __init__(self=Screen, params={'_terp_view_type': 'form', 'address_ids': {'_te..._terp_id': 396, '_terp_view_ids': [False, False]}, prefix='', name='', views_preloaded={}, hastoolbar=True, editable=True, readonly=False, selectable=2, nolinks=1)
    125 
    126         if self.view_mode:
    127             self.add_view_id(self.view_id, self.view_type)
    128 
    129     def add_view_id(self, view_id, view_type):
  self = Screen, self.add_view_id = <bound method Screen.add_view_id of Screen>, self.view_id = 300, self.view_type = 'form'
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/widgets/screen.py in add_view_id(self=Screen, view_id=False, view_type='form')
    137             view = cache.fields_view_get(self.model, view_id, view_type, ctx, self.hastoolbar)
    138 
    139         self.add_view(view, view_type)
    140 
    141     def add_view(self, view, view_type='form'):
  self = Screen, self.add_view = <bound method Screen.add_view of Screen>, view = {'arch': u'<?xml version="1.0" encoding="utf-8"?>\n<form str... </notebook>\n </form>', 'field_parent': False, 'fields': {'active': {'string': u'Active', 'type': u'boolean', 'views': {}}, 'address_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.address', 'string': u'Addresses', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Indirizzi">\n ...ield>\n </form>', 'fields': {'address_type_id': {...}, 'city': {...}, 'contact_ids': {...}, 'country_id': {...}, 'email': {...}, 'fax': {...}, 'mobile': {...}, 'phone': {...}, 'state_id': {...}, 'street': {...}, ...}}, 'tree': {'arch': u'<tree string="Indirizzi">\n ...ne"/>\n </tree>', 'fields': {'address_type_id': {...}, 'city': {...}, 'country_id': {...}, 'name': {...}, 'state_id': {...}, 'street': {...}, 'zip': {...}}}}}, 'associate_group_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.associate_group', 'string': u'Linked Groups', 'type': u'many2many', 'views': {}}, 'bank_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.bank', 'string': u'Banks', 'type': u'one2many', 'views': {}}, 'comment': {'string': u'Notes', 'type': u'text', 'views': {}}, 'name': {'required': True, 'select': True, 'size': 128, 'string': u'Name', 'type': u'char', 'views': {}}, 'subscription_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.subscription', 'string': u'Subscriptions', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Quote associative versate">\n ...ield>\n </form>', 'fields': {'computable_amount': {...}, 'excluded_amount': {...}, 'incidence_rate': {...}, 'subscription_detail_ids': {...}, 'total_amount': {...}, 'year': {...}}}, 'tree': {'arch': u'<tree string="Quote associative versate">\n ...no"/>\n </tree>', 'fields': {'computable_amount': {...}, 'excluded_amount': {...}, 'incidence_rate': {...}, 'total_amount': {...}, 'year': {...}}}}}, 'tax': {'size': 32, 'string': u'Tax', 'type': u'char', 'views': {}}, 'vat': {'help': u'Value Added Tax number. Check the box if the par...cted to the VAT. Used by the VAT legal statement.', 'size': 32, 'string': u'VAT', 'type': u'char', 'views': {}}, 'website': {'size': 64, 'string': u'Website', 'type': u'char', 'views': {}}}, 'model': u'spr.parreg.associate', 'name': u'associate_form', 'toolbar': {'action': [], 'print': [], 'relate': []}, 'type': u'form', 'view_id': 300}, view_type = 'form'
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/widgets/screen.py in add_view(self=Screen, view={'arch': u'<?xml version="1.0" encoding="utf-8"?>\n<form str... </notebook>\n </form>', 'field_parent': False, 'fields': {'active': {'string': u'Active', 'type': u'boolean', 'views': {}}, 'address_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.address', 'string': u'Addresses', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Indirizzi">\n ...ield>\n </form>', 'fields': {'address_type_id': {...}, 'city': {...}, 'contact_ids': {...}, 'country_id': {...}, 'email': {...}, 'fax': {...}, 'mobile': {...}, 'phone': {...}, 'state_id': {...}, 'street': {...}, ...}}, 'tree': {'arch': u'<tree string="Indirizzi">\n ...ne"/>\n </tree>', 'fields': {'address_type_id': {...}, 'city': {...}, 'country_id': {...}, 'name': {...}, 'state_id': {...}, 'street': {...}, 'zip': {...}}}}}, 'associate_group_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.associate_group', 'string': u'Linked Groups', 'type': u'many2many', 'views': {}}, 'bank_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.bank', 'string': u'Banks', 'type': u'one2many', 'views': {}}, 'comment': {'string': u'Notes', 'type': u'text', 'views': {}}, 'name': {'required': True, 'select': True, 'size': 128, 'string': u'Name', 'type': u'char', 'views': {}}, 'subscription_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.subscription', 'string': u'Subscriptions', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Quote associative versate">\n ...ield>\n </form>', 'fields': {'computable_amount': {...}, 'excluded_amount': {...}, 'incidence_rate': {...}, 'subscription_detail_ids': {...}, 'total_amount': {...}, 'year': {...}}}, 'tree': {'arch': u'<tree string="Quote associative versate">\n ...no"/>\n </tree>', 'fields': {'computable_amount': {...}, 'excluded_amount': {...}, 'incidence_rate': {...}, 'total_amount': {...}, 'year': {...}}}}}, 'tax': {'size': 32, 'string': u'Tax', 'type': u'char', 'views': {}}, 'vat': {'help': u'Value Added Tax number. Check the box if the par...cted to the VAT. Used by the VAT legal statement.', 'size': 32, 'string': u'VAT', 'type': u'char', 'views': {}}, 'website': {'size': 64, 'string': u'Website', 'type': u'char', 'views': {}}}, 'model': u'spr.parreg.associate', 'name': u'associate_form', 'toolbar': {'action': [], 'print': [], 'relate': []}, 'type': u'form', 'view_id': 300}, view_type='form')
    152                                     editable=self.editable,
    153                                     readonly=self.readonly,
    154                                     nodefault=self.nodefault, nolinks=self.link)
    155 
    156             if not self.is_wizard and self.ids is None:
  nodefault undefined, self = Screen, self.nodefault = False, nolinks undefined, self.link = 1
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/widgets/base/meta.py in wrapper(self=Form, *args=(), **kw={'context': {}, 'domain': [], 'editable': True, 'ids': [396], 'model': 'spr.parreg.associate', 'nodefault': False, 'nolinks': 1, 'prefix': '', 'readonly': False, 'view': {'arch': u'<?xml version="1.0" encoding="utf-8"?>\n<form str... </notebook>\n </form>', 'field_parent': False, 'fields': {'active': {'string': u'Active', 'type': u'boolean', 'views': {}}, 'address_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.address', 'string': u'Addresses', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Indirizzi">\n ...ield>\n </form>', 'fields': {...}}, 'tree': {'arch': u'<tree string="Indirizzi">\n ...ne"/>\n </tree>', 'fields': {...}}}}, 'associate_group_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.associate_group', 'string': u'Linked Groups', 'type': u'many2many', 'views': {}}, 'bank_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.bank', 'string': u'Banks', 'type': u'one2many', 'views': {}}, 'comment': {'string': u'Notes', 'type': u'text', 'views': {}}, 'name': {'required': True, 'select': True, 'size': 128, 'string': u'Name', 'type': u'char', 'views': {}}, 'subscription_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.subscription', 'string': u'Subscriptions', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Quote associative versate">\n ...ield>\n </form>', 'fields': {...}}, 'tree': {'arch': u'<tree string="Quote associative versate">\n ...no"/>\n </tree>', 'fields': {...}}}}, 'tax': {'size': 32, 'string': u'Tax', 'type': u'char', 'views': {}}, 'vat': {'help': u'Value Added Tax number. Check the box if the par...cted to the VAT. Used by the VAT legal statement.', 'size': 32, 'string': u'VAT', 'type': u'char', 'views': {}}, 'website': {'size': 64, 'string': u'Website', 'type': u'char', 'views': {}}}, 'model': u'spr.parreg.associate', 'name': u'associate_form', 'toolbar': {'action': [], 'print': [], 'relate': []}, 'type': u'form', 'view_id': 300}})
     38             self.__initstack.append(1)
     39 
     40         res = func(self, *args, **kw)
     41         try:
     42             self.__initstack.pop()
  res undefined, func = <function __init__ at 0x12b3500>, self = Form, args = (), kw = {'context': {}, 'domain': [], 'editable': True, 'ids': [396], 'model': 'spr.parreg.associate', 'nodefault': False, 'nolinks': 1, 'prefix': '', 'readonly': False, 'view': {'arch': u'<?xml version="1.0" encoding="utf-8"?>\n<form str... </notebook>\n </form>', 'field_parent': False, 'fields': {'active': {'string': u'Active', 'type': u'boolean', 'views': {}}, 'address_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.address', 'string': u'Addresses', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Indirizzi">\n ...ield>\n </form>', 'fields': {...}}, 'tree': {'arch': u'<tree string="Indirizzi">\n ...ne"/>\n </tree>', 'fields': {...}}}}, 'associate_group_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.associate_group', 'string': u'Linked Groups', 'type': u'many2many', 'views': {}}, 'bank_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.bank', 'string': u'Banks', 'type': u'one2many', 'views': {}}, 'comment': {'string': u'Notes', 'type': u'text', 'views': {}}, 'name': {'required': True, 'select': True, 'size': 128, 'string': u'Name', 'type': u'char', 'views': {}}, 'subscription_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.subscription', 'string': u'Subscriptions', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Quote associative versate">\n ...ield>\n </form>', 'fields': {...}}, 'tree': {'arch': u'<tree string="Quote associative versate">\n ...no"/>\n </tree>', 'fields': {...}}}}, 'tax': {'size': 32, 'string': u'Tax', 'type': u'char', 'views': {}}, 'vat': {'help': u'Value Added Tax number. Check the box if the par...cted to the VAT. Used by the VAT legal statement.', 'size': 32, 'string': u'VAT', 'type': u'char', 'views': {}}, 'website': {'size': 64, 'string': u'Website', 'type': u'char', 'views': {}}}, 'model': u'spr.parreg.associate', 'name': u'associate_form', 'toolbar': {'action': [], 'print': [], 'relate': []}, 'type': u'form', 'view_id': 300}}
   /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/widgets/form.py in __init__(self=Form, prefix='', model='spr.parreg.associate', view={'arch': u'<?xml version="1.0" encoding="utf-8"?>\n<form str... </notebook>\n </form>', 'field_parent': False, 'fields': {'active': {'string': u'Active', 'type': u'boolean', 'views': {}}, 'address_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.address', 'string': u'Addresses', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Indirizzi">\n ...ield>\n </form>', 'fields': {'address_type_id': {...}, 'city': {...}, 'contact_ids': {...}, 'country_id': {...}, 'email': {...}, 'fax': {...}, 'mobile': {...}, 'phone': {...}, 'state_id': {...}, 'street': {...}, ...}}, 'tree': {'arch': u'<tree string="Indirizzi">\n ...ne"/>\n </tree>', 'fields': {'address_type_id': {...}, 'city': {...}, 'country_id': {...}, 'name': {...}, 'state_id': {...}, 'street': {...}, 'zip': {...}}}}}, 'associate_group_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.associate_group', 'string': u'Linked Groups', 'type': u'many2many', 'views': {}}, 'bank_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.bank', 'string': u'Banks', 'type': u'one2many', 'views': {}}, 'comment': {'string': u'Notes', 'type': u'text', 'views': {}}, 'name': {'required': True, 'select': True, 'size': 128, 'string': u'Name', 'type': u'char', 'views': {}}, 'subscription_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.subscription', 'string': u'Subscriptions', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Quote associative versate">\n ...ield>\n </form>', 'fields': {'computable_amount': {...}, 'excluded_amount': {...}, 'incidence_rate': {...}, 'subscription_detail_ids': {...}, 'total_amount': {...}, 'year': {...}}}, 'tree': {'arch': u'<tree string="Quote associative versate">\n ...no"/>\n </tree>', 'fields': {'computable_amount': {...}, 'excluded_amount': {...}, 'incidence_rate': {...}, 'total_amount': {...}, 'year': {...}}}}}, 'tax': {'size': 32, 'string': u'Tax', 'type': u'char', 'views': {}}, 'vat': {'help': u'Value Added Tax number. Check the box if the par...cted to the VAT. Used by the VAT legal statement.', 'size': 32, 'string': u'VAT', 'type': u'char', 'views': {}}, 'website': {'size': 64, 'string': u'Website', 'type': u'char', 'views': {}}}, 'model': u'spr.parreg.associate', 'name': u'associate_form', 'toolbar': {'action': [], 'print': [], 'relate': []}, 'type': u'form', 'view_id': 300}, ids=[396], domain=[], context={}, editable=True, readonly=False, nodefault=False, nolinks=1)
    696 
    697         if ids:
    698             values = proxy.read(ids[:1], fields.keys() + ['__last_update'], ctx)[0]
    699             self.id = ids[0]
    700             self._update_concurrency_info(self.model, [values])
  values = {}, proxy = <openerp.rpc.RPCProxy object at 0x1a12dd0>, proxy.read = <function <lambda> at 0x1bf5938>, ids = [396], fields = {'active': {'string': u'Active', 'type': u'boolean', 'views': {}}, 'address_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.address', 'string': u'Addresses', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Indirizzi">\n ...ield>\n </form>', 'fields': {'address_type_id': {'context': u'', 'domain': [], 'relation': u'spr.parreg.address_type', 'required': True, 'string': u'Address type', 'type': u'many2one', 'views': {}}, 'city': {'size': 128, 'string': u'City', 'type': u'char', 'views': {}}, 'contact_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.contact', 'string': u'Related contacts', 'type': u'one2many', 'views': {...}}, 'country_id': {'context': u'', 'domain': [], 'relation': u'res.country', 'string': u'Country', 'type': u'many2one', 'views': {}}, 'email': {'size': 240, 'string': u'E-Mail', 'type': u'char', 'views': {}}, 'fax': {'size': 64, 'string': u'Fax', 'type': u'char', 'views': {}}, 'mobile': {'size': 64, 'string': u'Mobile', 'type': u'char', 'views': {}}, 'phone': {'size': 64, 'string': u'Phone', 'type': u'char', 'views': {}}, 'state_id': {'context': u'', 'domain': u"[('country_id','=',country_id)]", 'relation': u'res.country.state', 'string': u'Fed. State', 'type': u'many2one', 'views': {}}, 'street': {'size': 128, 'string': u'Street', 'type': u'char', 'views': {}}, ...}}, 'tree': {'arch': u'<tree string="Indirizzi">\n ...ne"/>\n </tree>', 'fields': {'address_type_id': {'context': u'', 'domain': [], 'relation': u'spr.parreg.address_type', 'required': True, 'string': u'Address type', 'type': u'many2one', 'views': {}}, 'city': {'size': 128, 'string': u'City', 'type': u'char', 'views': {}}, 'country_id': {'context': u'', 'domain': [], 'relation': u'res.country', 'string': u'Country', 'type': u'many2one', 'views': {}}, 'name': {'size': 64, 'string': u'Contact Name', 'type': u'char', 'views': {}}, 'state_id': {'context': u'', 'domain': u"[('country_id','=',country_id)]", 'relation': u'res.country.state', 'string': u'Fed. State', 'type': u'many2one', 'views': {}}, 'street': {'size': 128, 'string': u'Street', 'type': u'char', 'views': {}}, 'zip': {'change_default': True, 'size': 24, 'string': u'Zip', 'type': u'char', 'views': {}}}}}}, 'associate_group_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.associate_group', 'string': u'Linked Groups', 'type': u'many2many', 'views': {}}, 'bank_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.bank', 'string': u'Banks', 'type': u'one2many', 'views': {}}, 'comment': {'string': u'Notes', 'type': u'text', 'views': {}}, 'name': {'required': True, 'select': True, 'size': 128, 'string': u'Name', 'type': u'char', 'views': {}}, 'subscription_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.subscription', 'string': u'Subscriptions', 'type': u'one2many', 'views': {'form': {'arch': u'<form string="Quote associative versate">\n ...ield>\n </form>', 'fields': {'computable_amount': {'digits': (...), 'readonly': 1, 'string': u'Computable amount', 'type': u'float', 'views': {}}, 'excluded_amount': {'digits': (...), 'readonly': 1, 'string': u'Excluded amount', 'type': u'float', 'views': {}}, 'incidence_rate': {'digits': (...), 'readonly': 1, 'string': u'Incidence Rate', 'type': u'float', 'views': {}}, 'subscription_detail_ids': {'context': u'', 'domain': [], 'relation': u'spr.parreg.subscription_detail', 'string': u'Subscription', 'type': u'one2many', 'views': {...}}, 'total_amount': {'digits': (...), 'readonly': 1, 'string': u'Total amount', 'type': u'float', 'views': {}}, 'year': {'required': True, 'string': u'Year', 'type': u'integer', 'views': {}}}}, 'tree': {'arch': u'<tree string="Quote associative versate">\n ...no"/>\n </tree>', 'fields': {'computable_amount': {'digits': (...), 'readonly': 1, 'string': u'Computable amount', 'type': u'float', 'views': {}}, 'excluded_amount': {'digits': (...), 'readonly': 1, 'string': u'Excluded amount', 'type': u'float', 'views': {}}, 'incidence_rate': {'digits': (...), 'readonly': 1, 'string': u'Incidence Rate', 'type': u'float', 'views': {}}, 'total_amount': {'digits': (...), 'readonly': 1, 'string': u'Total amount', 'type': u'float', 'views': {}}, 'year': {'required': True, 'string': u'Year', 'type': u'integer', 'views': {}}}}}}, 'tax': {'size': 32, 'string': u'Tax', 'type': u'char', 'views': {}}, 'vat': {'help': u'Value Added Tax number. Check the box if the par...cted to the VAT. Used by the VAT legal statement.', 'size': 32, 'string': u'VAT', 'type': u'char', 'views': {}}, 'website': {'size': 64, 'string': u'Website', 'type': u'char', 'views': {}}}, fields.keys = <built-in method keys of dict object at 0x20af380>, ctx = {'bin_size': True, 'client': 'web', 'lang': u'en_US', 'tz': False}

  <type 'exceptions.IndexError'>: list index out of range
        args = ('list index out of range',)
        message = 'list index out of range' 

  Credits for the patch: Niko Mennucci