Merge lp:~openerp-dev/openobject-server/m2o_with_selection into lp:~openerp-dev/openobject-server/trunk-dev-framework

Proposed by Ravi Gadhia (OpenERP)
Status: Rejected
Rejected by: Naresh(OpenERP)
Proposed branch: lp:~openerp-dev/openobject-server/m2o_with_selection
Merge into: lp:~openerp-dev/openobject-server/trunk-dev-framework
Diff against target: 21 lines (+1/-3)
1 file modified
openerp/osv/orm.py (+1/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/m2o_with_selection
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Needs Resubmitting
Olivier Dony (Odoo) Pending
Review via email: mp+49362@code.launchpad.net

Description of the change

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 get value on popup by name_search and we can apply domain as like M2O field

For selection field: if it has function to get selection value it also call at field popup time

related server branch:
https://code.launchpad.net/~openerp-dev/openobject-client/m2o_with_selection

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Reasons:

1: send proposal to Trunk server
2: feature should only be available for widget=selection.

Thanks

review: Needs Resubmitting

Unmerged revisions

3355. By Ravi Gadhia (OpenERP)

Merge with trunk-dev-framework

3354. By Ravi Gadhia (OpenERP)

[IMP] Improve selection field at client side so it's no need to send selection value at view load time, client get it's by name_search when combobox popup

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openerp/osv/orm.py'
--- openerp/osv/orm.py 2011-02-08 16:49:23 +0000
+++ openerp/osv/orm.py 2011-02-11 10:21:53 +0000
@@ -1124,6 +1124,7 @@
1124 else:1124 else:
1125 # call the 'dynamic selection' function1125 # call the 'dynamic selection' function
1126 res[f]['selection'] = field_col.selection(self, cr, user, context)1126 res[f]['selection'] = field_col.selection(self, cr, user, context)
1127 res[f]['has_func'] = True
1127 if res[f]['type'] in ('one2many', 'many2many', 'many2one', 'one2one'):1128 if res[f]['type'] in ('one2many', 'many2many', 'many2one', 'one2one'):
1128 res[f]['relation'] = field_col._obj1129 res[f]['relation'] = field_col._obj
1129 res[f]['domain'] = field_col._domain1130 res[f]['domain'] = field_col._domain
@@ -1234,9 +1235,6 @@
1234 search_context = dict(context)1235 search_context = dict(context)
1235 if column._context and not isinstance(column._context, basestring):1236 if column._context and not isinstance(column._context, basestring):
1236 search_context.update(column._context)1237 search_context.update(column._context)
1237 attrs['selection'] = relation._name_search(cr, user, '', dom, context=search_context, limit=None, name_get_uid=1)
1238 if (node.get('required') and not int(node.get('required'))) or not column.required:
1239 attrs['selection'].append((False, ''))
1240 fields[node.get('name')] = attrs1238 fields[node.get('name')] = attrs
12411239
1242 elif node.tag in ('form', 'tree'):1240 elif node.tag in ('form', 'tree'):

Subscribers

People subscribed via source and target branches