From 50f2a6d59271eff8c650af1c531ee4ee22d09116 Mon Sep 17 00:00:00 2001 From: santiky Date: Fri, 22 Apr 2022 19:07:07 +0200 Subject: [PATCH] =?UTF-8?q?fix=20error=20al=20crear=20producto=20sin=20ten?= =?UTF-8?q?er=20ninguna=20cateegor=C3=ADa=20p=C3=BAblica=20definida?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/product_product.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)