Somesh Khare(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-572802-skh into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-572802-skh/+merge/100146

Hello Sir,

[Fix]: On the stock move filter "Product" when you search the product the limit 
into the name_search() goes "None".
 Current Result : No move for the search product
 Expected Result: Should show all move for the Product

Kindly review the branch and please share your view on it,

Thanks
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-572802-skh/+merge/100146
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-572802-skh.
=== modified file 'product/product.py'
--- product/product.py	2012-02-14 14:34:20 +0000
+++ product/product.py	2012-03-30 13:42:20 +0000
@@ -598,6 +598,7 @@
         return result
 
     def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
+        print "Limit:::",limit
         if not args:
             args = []
         if name:
@@ -611,9 +612,10 @@
                 # Performing a quick memory merge of ids in Python will give much better performance
                 ids = set()
                 ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context))
-                if len(ids) < limit:
+                if not limit or len(ids) < limit:
+                    print "Limit2@@@:::",limit , len(ids)
                     # we may underrun the limit because of dupes in the results, that's fine
-                    ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids)), context=context))
+                    ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids) if limit else limit) , context=context))
                 ids = list(ids)
             if not ids:
                 ptrn = re.compile('(\[(.*?)\])')

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to