Merge lp:~openerp-dev/openobject-client/6.0-opw-16409-ado into lp:openobject-client/6.0

Proposed by Amit Dodiya (OpenERP)
Status: Merged
Approved by: Jay Vora (Serpent Consulting Services)
Approved revision: 1877
Merged at revision: 1884
Proposed branch: lp:~openerp-dev/openobject-client/6.0-opw-16409-ado
Merge into: lp:openobject-client/6.0
Diff against target: 49 lines (+8/-2)
3 files modified
bin/modules/gui/window/win_search.py (+4/-1)
bin/widget/view/form_gtk/many2many.py (+2/-0)
bin/widget/view/form_gtk/many2one.py (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.0-opw-16409-ado
Reviewer Review Type Date Requested Status
Jay Vora (Serpent Consulting Services) (community) Approve
Review via email: mp+69411@code.launchpad.net

Description of the change

Hello Sir,

[Fix]: searching for a partner from a purchase order only gets a limited result.

I have removed the "[('id','in', self.ids)]" domain from def go() method which cause a limited result for partner while you select the partner in M2O field in purchase order while you have partner more than the limit.

Thanks,
Amit.

To post a comment you must log in.
1877. By Amit Dodiya (OpenERP)

[FIX]: M2O search for supplier in purchase_order: case(16409)

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/modules/gui/window/win_search.py'
--- bin/modules/gui/window/win_search.py 2010-12-03 11:55:42 +0000
+++ bin/modules/gui/window/win_search.py 2011-07-27 10:39:38 +0000
@@ -111,6 +111,7 @@
111 self.model = model111 self.model = model
112 self.sel_multi = sel_multi112 self.sel_multi = sel_multi
113 self.ids = ids113 self.ids = ids
114 self.ctx = context
114 self.glade = glade.XML(common.terp_path("openerp.glade"),'win_search',gettext.textdomain())115 self.glade = glade.XML(common.terp_path("openerp.glade"),'win_search',gettext.textdomain())
115 self.win = self.glade.get_widget('win_search')116 self.win = self.glade.get_widget('win_search')
116 self.win.set_icon(common.OPENERP_ICON)117 self.win.set_icon(common.OPENERP_ICON)
@@ -184,7 +185,9 @@
184 def go(self):185 def go(self):
185 ## This is if the user has set some filters by default with search_default_XXX186 ## This is if the user has set some filters by default with search_default_XXX
186 if self.ids:187 if self.ids:
187 self.screen.win_search_domain += [('id','in', self.ids)]188 #Add the domain only if there was no name_search performed with name
189 name_search = self.ctx.get('name_search',False)
190 self.screen.win_search_domain += [('id','in', self.ids)] if name_search else []
188 self.find()191 self.find()
189 else:192 else:
190 self.screen.update_scroll()193 self.screen.update_scroll()
191194
=== modified file 'bin/widget/view/form_gtk/many2many.py'
--- bin/widget/view/form_gtk/many2many.py 2010-12-13 12:46:13 +0000
+++ bin/widget/view/form_gtk/many2many.py 2011-07-27 10:39:38 +0000
@@ -147,6 +147,8 @@
147 self.attrs['relation'], 'name_search',147 self.attrs['relation'], 'name_search',
148 self.wid_text.get_text(), domain, 'ilike', context)148 self.wid_text.get_text(), domain, 'ilike', context)
149 ids = [oid for oid, _ in records]149 ids = [oid for oid, _ in records]
150 #Updating the context in order to avoid domain of name_search and custom domain of search_context
151 context.update({'name_search':self.wid_text.get_text()})
150 self.wid_text.set_text('')152 self.wid_text.set_text('')
151 win = win_search(self.attrs['relation'], sel_multi=True, ids=ids, context=context, domain=domain, parent=self._window)153 win = win_search(self.attrs['relation'], sel_multi=True, ids=ids, context=context, domain=domain, parent=self._window)
152 ids = win.go()154 ids = win.go()
153155
=== modified file 'bin/widget/view/form_gtk/many2one.py'
--- bin/widget/view/form_gtk/many2one.py 2010-12-03 11:55:42 +0000
+++ bin/widget/view/form_gtk/many2one.py 2011-07-27 10:39:38 +0000
@@ -260,7 +260,8 @@
260 self.display(self._view.model, self._view.modelfield)260 self.display(self._view.model, self._view.modelfield)
261 self.ok = True261 self.ok = True
262 return True262 return True
263263 #Updating the context in order to avoid domain of name_search and custom domain of search_context
264 context.update({'name_search':name_search})
264 win = win_search(self.attrs['relation'], sel_multi=False, ids=map(lambda x: x[0], ids), context=context, domain=domain, parent=self._window)265 win = win_search(self.attrs['relation'], sel_multi=False, ids=map(lambda x: x[0], ids), context=context, domain=domain, parent=self._window)
265 ids = win.go()266 ids = win.go()
266 if ids:267 if ids: