[FIX]delivery: make a name_search method on prfix
authorMayur Maheshwari (OpenERP) <mma@tinyerp.com>
Thu, 15 Dec 2011 13:26:03 +0000 (18:56 +0530)
committerMayur Maheshwari (OpenERP) <mma@tinyerp.com>
Thu, 15 Dec 2011 13:26:03 +0000 (18:56 +0530)
lp bug: https://launchpad.net/bugs/904495 fixed

bzr revid: mma@tinyerp.com-20111215132603-s1sl8s214kc53gka

addons/stock/stock.py

index 461c863..adb04b9 100644 (file)
@@ -1360,6 +1360,11 @@ class stock_production_lot(osv.osv):
                 name = '%s [%s]' % (name, record['ref'])
             res.append((record['id'], name))
         return res
+    
+    def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
+        ids = self.search(cr, user, [('prefix',operator,name)]+ args, limit=limit, context=context)
+        result = self.name_get(cr, user, ids, context=context)
+        return result
 
     _name = 'stock.production.lot'
     _description = 'Production lot'