[FIX]delivery: make a name_search method on prfix

lp bug: https://launchpad.net/bugs/904495 fixed

bzr revid: mma@tinyerp.com-20111215132603-s1sl8s214kc53gka
This commit is contained in:
Mayur Maheshwari (OpenERP) 2011-12-15 18:56:03 +05:30
parent 2432b9d0f9
commit 153c913525
1 changed files with 5 additions and 0 deletions

View 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'