[REM] preprocess of widget selection on m2o

As they are now directly supported by the webclient since commit
web 3863 nicolas.vanhoren@openerp.com-20131022131525-d0i61sbm0w6katfs

bzr revid: al@openerp.com-20140121112759-zavwqdyv8kdq4oys
This commit is contained in:
Antony Lesuisse 2014-01-21 12:27:59 +01:00
parent 8702ef5d3b
commit 658ed76a84
1 changed files with 0 additions and 20 deletions

View File

@ -538,26 +538,6 @@ class view(osv.osv):
'fields': xfields
}
attrs = {'views': views}
if node.get('widget') and node.get('widget') == 'selection':
# Prepare the cached selection list for the client. This needs to be
# done even when the field is invisible to the current user, because
# other events could need to change its value to any of the selectable ones
# (such as on_change events, refreshes, etc.)
# If domain and context are strings, we keep them for client-side, otherwise
# we evaluate them server-side to consider them when generating the list of
# possible values
# TODO: find a way to remove this hack, by allow dynamic domains
dom = []
if column._domain and not isinstance(column._domain, basestring):
dom = list(column._domain)
dom += eval(node.get('domain', '[]'), {'uid': user, 'time': time})
search_context = dict(context)
if column._context and not isinstance(column._context, basestring):
search_context.update(column._context)
attrs['selection'] = relation._name_search(cr, user, '', dom, context=search_context, limit=None, name_get_uid=1)
if (node.get('required') and not int(node.get('required'))) or not column.required:
attrs['selection'].append((False, ''))
fields[node.get('name')] = attrs
field = model_fields.get(node.get('name'))