Fix OpenProductCostHistory when data['id'] doesn't exist for issue1115

This commit is contained in:
Cédric Krier committed 2009-07-18 13:57:56 +02:00
1 parent c3c1af483d
commit 65bc680887
1 file changed
+5 -2
+5 -2
View File
@@ -61,8 +61,11 @@ class OpenProductCostHistory(Wizard):
context=context)
res = act_window_obj.read(cursor, user, model_data.db_id, context=context)
product = product_obj.browse(cursor, user, data['id'], context=context)
res['domain'] = str([('template', '=', product.template.id)])
if not data['id'] or data['id'] < 0:
res['domain'] = str([('template', '=', False)])
else:
product = product_obj.browse(cursor, user, data['id'], context=context)
res['domain'] = str([('template', '=', product.template.id)])
return res
OpenProductCostHistory()