← Back to team overview

openerp-community team mailing list archive

lp:~openerp-community/openobject-client/trunk-bug-880592-moylop260 into lp:openobject-client

 

moylop260 - http://www.vauxoo.com has proposed merging lp:~openerp-community/openobject-client/trunk-bug-880592-moylop260 into lp:openobject-client.

Requested reviews:
  OpenERP sa GTK client R&D (openerp-dev-gtk)
Related bugs:
  Bug #880592 in OpenERP GTK Client: "[WISHLIST] [6.0] Widget many2many no set directly id when len is just one"
  https://bugs.launchpad.net/openobject-client/+bug/880592

For more details, see:
https://code.launchpad.net/~openerp-community/openobject-client/trunk-bug-880592-moylop260/+merge/80170

[WISHLIST] [6.0] Widget many2many no set directly id when len is just one

Widget many2many no set directly id when len is just one

In the widget many2one when return one value, these set it when these value without sub view
But in many2many no is this case
-- 
https://code.launchpad.net/~openerp-community/openobject-client/trunk-bug-880592-moylop260/+merge/80170
Your team OpenERP Community is subscribed to branch lp:~openerp-community/openobject-client/trunk-bug-880592-moylop260.
=== modified file 'bin/widget/view/form_gtk/many2many.py'
--- bin/widget/view/form_gtk/many2many.py	2011-05-26 12:41:27 +0000
+++ bin/widget/view/form_gtk/many2many.py	2011-10-24 01:47:24 +0000
@@ -152,8 +152,11 @@
                                         self.wid_text.get_text(), domain, 'ilike', context)
         ids = [oid for oid, _ in records]
         self.wid_text.set_text('')
-        win = win_search(self.attrs['relation'], sel_multi=True, ids=ids, context=context, domain=domain, parent=self._window)
-        ids = win.go()
+        if len(ids) == 1:
+            pass
+        else:
+            win = win_search(self.attrs['relation'], sel_multi=True, ids=ids, context=context, domain=domain, parent=self._window)
+            ids = win.go()
 
         if ids != None:
             if self.name in self.model.pager_cache: