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
1=== modified file 'bin/modules/gui/window/win_search.py'
2--- bin/modules/gui/window/win_search.py 2010-12-03 11:55:42 +0000
3+++ bin/modules/gui/window/win_search.py 2011-07-27 10:39:38 +0000
4@@ -111,6 +111,7 @@
5 self.model = model
6 self.sel_multi = sel_multi
7 self.ids = ids
8+ self.ctx = context
9 self.glade = glade.XML(common.terp_path("openerp.glade"),'win_search',gettext.textdomain())
10 self.win = self.glade.get_widget('win_search')
11 self.win.set_icon(common.OPENERP_ICON)
12@@ -184,7 +185,9 @@
13 def go(self):
14 ## This is if the user has set some filters by default with search_default_XXX
15 if self.ids:
16- self.screen.win_search_domain += [('id','in', self.ids)]
17+ #Add the domain only if there was no name_search performed with name
18+ name_search = self.ctx.get('name_search',False)
19+ self.screen.win_search_domain += [('id','in', self.ids)] if name_search else []
20 self.find()
21 else:
22 self.screen.update_scroll()
23
24=== modified file 'bin/widget/view/form_gtk/many2many.py'
25--- bin/widget/view/form_gtk/many2many.py 2010-12-13 12:46:13 +0000
26+++ bin/widget/view/form_gtk/many2many.py 2011-07-27 10:39:38 +0000
27@@ -147,6 +147,8 @@
28 self.attrs['relation'], 'name_search',
29 self.wid_text.get_text(), domain, 'ilike', context)
30 ids = [oid for oid, _ in records]
31+ #Updating the context in order to avoid domain of name_search and custom domain of search_context
32+ context.update({'name_search':self.wid_text.get_text()})
33 self.wid_text.set_text('')
34 win = win_search(self.attrs['relation'], sel_multi=True, ids=ids, context=context, domain=domain, parent=self._window)
35 ids = win.go()
36
37=== modified file 'bin/widget/view/form_gtk/many2one.py'
38--- bin/widget/view/form_gtk/many2one.py 2010-12-03 11:55:42 +0000
39+++ bin/widget/view/form_gtk/many2one.py 2011-07-27 10:39:38 +0000
40@@ -260,7 +260,8 @@
41 self.display(self._view.model, self._view.modelfield)
42 self.ok = True
43 return True
44-
45+ #Updating the context in order to avoid domain of name_search and custom domain of search_context
46+ context.update({'name_search':name_search})
47 win = win_search(self.attrs['relation'], sel_multi=False, ids=map(lambda x: x[0], ids), context=context, domain=domain, parent=self._window)
48 ids = win.go()
49 if ids: