Fix OpenProductCostHistory when data['id'] doesn't exist for issue1115
This commit is contained in:
1 parent
c3c1af483d
commit
65bc680887
1 file changed
+5
-2
+5
-2
@@ -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()
|
||||
Reference in new issue
Block a user