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
=== modified file 'product/product.py'
--- product/product.py 2012-04-03 13:05:28 +0000
+++ product/product.py 2012-08-08 09:09:24 +0000
@@ -601,9 +601,9 @@
601 if not args:601 if not args:
602 args = []602 args = []
603 if name:603 if name:
604 ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context)604 ids = self.search(cr, user, args + [('default_code','=',name)], limit=limit, context=context)
605 if not ids:605 if not ids:
606 ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context)606 ids = self.search(cr, user,args + [('ean13','=',name)], limit=limit, context=context)
607 if not ids:607 if not ids:
608 # Do not merge the 2 next lines into one single search, SQL search performance would be abysmal608 # Do not merge the 2 next lines into one single search, SQL search performance would be abysmal
609 # on a database with thousands of matching products, due to the huge merge+unique needed for the609 # on a database with thousands of matching products, due to the huge merge+unique needed for the
@@ -619,7 +619,7 @@
619 ptrn = re.compile('(\[(.*?)\])')619 ptrn = re.compile('(\[(.*?)\])')
620 res = ptrn.search(name)620 res = ptrn.search(name)
621 if res:621 if res:
622 ids = self.search(cr, user, [('default_code','=', res.group(2))] + args, limit=limit, context=context)622 ids = self.search(cr, user,args + [('default_code','=', res.group(2))], limit=limit, context=context)
623 else:623 else:
624 ids = self.search(cr, user, args, limit=limit, context=context)624 ids = self.search(cr, user, args, limit=limit, context=context)
625 result = self.name_get(cr, user, ids, context=context)625 result = self.name_get(cr, user, ids, context=context)