Merge lp:~scigghiateam/openobject-addons/fix_bug_1028287 into lp:openobject-addons/6.1

Proposed by Andrea Cometa
Status: Needs review
Proposed branch: lp:~scigghiateam/openobject-addons/fix_bug_1028287
Merge into: lp:openobject-addons/6.1
Diff against target: 24 lines (+3/-3)
1 file modified
product/product.py (+3/-3)
To merge this branch: bzr merge lp:~scigghiateam/openobject-addons/fix_bug_1028287
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+118694@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Andrea Cometa (scigghia) wrote :

this merge proposal fix the bug #1028287

Unmerged revisions

6938. By Andrea Cometa

[FIX] proposal to fix bug #1028287

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product/product.py'
2--- product/product.py 2012-04-03 13:05:28 +0000
3+++ product/product.py 2012-08-08 09:09:24 +0000
4@@ -601,9 +601,9 @@
5 if not args:
6 args = []
7 if name:
8- ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context)
9+ ids = self.search(cr, user, args + [('default_code','=',name)], limit=limit, context=context)
10 if not ids:
11- ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context)
12+ ids = self.search(cr, user,args + [('ean13','=',name)], limit=limit, context=context)
13 if not ids:
14 # Do not merge the 2 next lines into one single search, SQL search performance would be abysmal
15 # on a database with thousands of matching products, due to the huge merge+unique needed for the
16@@ -619,7 +619,7 @@
17 ptrn = re.compile('(\[(.*?)\])')
18 res = ptrn.search(name)
19 if res:
20- ids = self.search(cr, user, [('default_code','=', res.group(2))] + args, limit=limit, context=context)
21+ ids = self.search(cr, user,args + [('default_code','=', res.group(2))], limit=limit, context=context)
22 else:
23 ids = self.search(cr, user, args, limit=limit, context=context)
24 result = self.name_get(cr, user, ids, context=context)