[FIX]product:search method added for searching products by category

bzr revid: kbh@tinyerp.com-20120911083919-cwenu6oum79oa7do
This commit is contained in:
Khushboo Bhatt (Open ERP) 2012-09-11 14:09:19 +05:30
parent 063c548209
commit af1df4d5cd
1 changed files with 8 additions and 0 deletions

View File

@ -743,6 +743,14 @@ class product_product(osv.osv):
else:
return super(product_product, self).copy(cr, uid, id, default=default,
context=context)
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
if context is None:
context = {}
if context and context.get('search_default_categ_id', False):
args.append((('categ_id', 'child_of', context['search_default_categ_id'])))
return super(product_product, self).search(cr, uid, args, offset, limit, order, context, count)
product_product()
class product_packaging(osv.osv):