[FIX] mrp: name_search where args is not defined

In case of name_search with no args (default None, see #8492 for example of
valid scenario, during import)
Construct the domain correcty.

Fixes #8492
This commit is contained in:
bramsi 2015-09-11 09:59:15 +07:00 committed by Martin Trigaux
parent 4f2bd0b9ea
commit 979d23ad8c
1 changed files with 1 additions and 0 deletions

View File

@ -832,6 +832,7 @@ class product_template(osv.osv):
template_ids.add(p.product_tmpl_id.id)
while (results and len(template_ids) < limit):
domain = [('product_tmpl_id', 'not in', list(template_ids))]
args = args if args is not None else []
results = product_product.name_search(
cr, user, name, args+domain, operator=operator, context=context, limit=limit)
product_ids = [p[0] for p in results]