diff --git a/product_category_default_ecommerce_cat/models/product_product.py b/product_category_default_ecommerce_cat/models/product_product.py index 3f1f985..935b418 100644 --- a/product_category_default_ecommerce_cat/models/product_product.py +++ b/product_category_default_ecommerce_cat/models/product_product.py @@ -16,7 +16,8 @@ class ProductProduct(models.Model): #check if there are public categories setup by user new_cats = [] old_cats = vals.get("public_categ_ids") - if old_cats[0][2]: + if old_cats: + if old_cats[0][2]: for i in old_cats[0][2]: new_cats.append(i) category = self.env['product.category'].browse(categ_id)