Code review comment for lp:~numerigraphe/openobject-server/trunk-partner-category-short-name

Revision history for this message
Numérigraphe (numerigraphe) wrote :

Dear Olivier,
Thanks for your attention.
I don't think I made anything special...
In the module l10n_fr_naf_ape from lp:openerp-nomenclatures, I used the context in the field "APE" on the partner form:
    <field name="ape_id" context="{'partner_category_display': 'short'}" domain="[('parent_id', 'child_of', 'NACE')]"/>

When I press F2 on this field I get this traceback:
"Environment Information :
System : Linux-3.0.0-14-generic-x86_64-with-Ubuntu-11.10-oneiric
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric
Operating System Release : 3.0.0-14-generic
Operating System Version : #23-Ubuntu SMP Mon Nov 21 20:28:43 UTC 2011
Operating System Architecture : 64bit
Operating System Locale : fr_FR.UTF-8
Python Version : 2.7.2+
OpenERP-Client Version : 6.1beta
Last revision No. & ID :2029 launchpad_translations_on_behalf_of_openerp-20120109044959-tc9h2xlv1507htn3
Traceback (most recent call last):
  File "/home/ls/Sources/openerp/trunk/server/openerp/service/netrpc_server.py", line 62, in run
    result = netsvc.dispatch_rpc(msg[0], msg[1], msg[2:])
  File "/home/ls/Sources/openerp/trunk/server/openerp/netsvc.py", line 325, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/ls/Sources/openerp/trunk/server/openerp/service/web_services.py", line 580, in dispatch
    res = fn(db, uid, *params)
  File "/home/ls/Sources/openerp/trunk/server/openerp/osv/osv.py", line 120, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/ls/Sources/openerp/trunk/server/openerp/osv/osv.py", line 175, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/ls/Sources/openerp/trunk/server/openerp/osv/osv.py", line 163, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/ls/Sources/openerp/trunk/server/openerp/addons/base/res/res_partner.py", line 72, in name_search
    ids = self.search(cr, uid, args, limit=limit, context=context)
  File "/home/ls/Sources/openerp/trunk/server/openerp/osv/orm.py", line 2230, in search
    return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
  File "/home/ls/Sources/openerp/trunk/server/openerp/osv/orm.py", line 4533, in _search
    query = self._where_calc(cr, user, args, context=context)
  File "/home/ls/Sources/openerp/trunk/server/openerp/osv/orm.py", line 4382, in _where_calc
    e = expression.expression(cr, user, domain, self, context)
  File "/home/ls/Sources/openerp/trunk/server/openerp/osv/expression.py", line 358, in __init__
    self.parse(cr, uid, distribute_not(normalize(exp)), table, context)
  File "/home/ls/Sources/openerp/trunk/server/openerp/osv/expression.py", line 570, in parse
    ids2 = to_ids(right, field_obj)
  File "/home/ls/Sources/openerp/trunk/server/openerp/osv/expression.py", line 403, in to_ids
    for n in names])
  File "/home/ls/Sources/openerp/trunk/server/openerp/addons/base/res/res_partner.py", line 73, in name_search
    return self.name_get(cr, uid, ids, context)
  File "/home/ls/Sources/openerp/trunk/server/openerp/addons/base/res/res_partner.py", line 52, in name_get
    return super(res_partner_category, self).name_get(cr, uid, ids, context=context)
  File "/home/ls/Sources/openerp/trunk/server/openerp/addons/base/res/res_partner.py", line 52, in name_get
    return super(res_partner_category, self).name_get(cr, uid, ids, context=context)
(...repeated many times...)
  File "/home/ls/Sources/openerp/trunk/server/openerp/addons/base/res/res_partner.py", line 52, in name_get
    return super(res_partner_category, self).name_get(cr, uid, ids, context=context)
  File "/home/ls/Sources/openerp/trunk/server/openerp/addons/base/res/res_partner.py", line 51, in name_get
    if context.get('partner_category_display') == 'short':
RuntimeError: maximum recursion depth exceeded in cmp"

Does it make sense ?
Lionel Sausin

« Back to merge proposal