[FIX] product: default category

If `product_category_all` is of type view, the installation of some
modules, such as delivery, crashes.

opw-749550
This commit is contained in:
Nicolas Martinelli
2017-06-30 09:12:54 +02:00
parent cc06f7c140
commit af11e74c2e
+1 -1
View File
@@ -20,7 +20,7 @@ class ProductTemplate(models.Model):
if self._context.get('categ_id') or self._context.get('default_categ_id'):
return self._context.get('categ_id') or self._context.get('default_categ_id')
category = self.env.ref('product.product_category_all', raise_if_not_found=False)
return category and category.id or False
return category.id if category.type == 'normal' else False
def _get_default_uom_id(self):
return self.env["product.uom"].search([], limit=1, order='id').id