← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-server/trunk-M2O_with_selection-rga into lp:openobject-server

 

Ravi Gadhia (OpenERP) has proposed merging lp:~openerp-dev/openobject-server/trunk-M2O_with_selection-rga into lp:openobject-server.

Requested reviews:
  OpenERP buildbot (openerp-buildbot)
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-M2O_with_selection-rga/+merge/58300

Hello,

Improve selection field.

Now M2O field with widget="selection" no need to pre-load selection value (at time of fields_view_get) it's(combobox) get value on popup by name_search and we can apply domain as like M2O field

related client branch:
lp:~openerp-dev/openobject-client/trunk-m2o_with_selection-rga
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-M2O_with_selection-rga/+merge/58300
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-server/trunk-M2O_with_selection-rga.
=== modified file 'openerp/osv/orm.py'
--- openerp/osv/orm.py	2011-04-11 10:13:27 +0000
+++ openerp/osv/orm.py	2011-04-19 13:17:24 +0000
@@ -1224,26 +1224,6 @@
                                 '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 = 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
 
         elif node.tag in ('form', 'tree'):