diff --git a/addons/product/product.py b/addons/product/product.py index ce17af7f88f..83ab8183f7a 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -589,6 +589,9 @@ class product_product(osv.osv): unlink_ids = [] unlink_product_tmpl_ids = [] for product in self.browse(cr, uid, ids, context=context): + # Check if product still exists, in case it has been unlinked by unlinking its template + if not product.exists(): + continue tmpl_id = product.product_tmpl_id.id # Check if the product is last product of this template other_product_ids = self.search(cr, uid, [('product_tmpl_id', '=', tmpl_id), ('id', '!=', product.id)], context=context)