[FIX] product: product.name_get() was O(n) instead of O(1) wrt db queries!

bzr revid: odo@openerp.com-20101221193203-51vp0cotd7nc3y7h
This commit is contained in:
Olivier Dony 2010-12-21 20:32:03 +01:00
parent 033179095f
commit 5cc52dfff1
1 changed files with 7 additions and 1 deletions

View File

@ -530,7 +530,13 @@ class product_product(osv.osv):
}
result.append(_name_get(mydict))
else:
result.append(_name_get(self.read(cr, user, product.id, ['variants','name','default_code'], context=context)))
mydict = {
'id': product.id,
'name': product.name,
'default_code': product.default_code,
'variants': product.variants
}
result.append(_name_get(mydict))
return result
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):