From c3e412aafd48ef1ff2d3b1cd061e2e639d6fda86 Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Tue, 3 Oct 2023 15:27:33 +0200 Subject: [PATCH] [FIX] point_of_sale: products w/ unloaded category belong to root It's possible that a product is loaded but its pos.category is not, e.g. when loading a menu product (product with detailed_type='combo'), the components will also be loaded. In this case, the product's pos.category will be null and the product won't be visible even when in the root category. This commit makes sure that if a product's pos.category is not loaded, the product will be visible in the root category. Part-of: odoo/odoo#138352 --- addons/point_of_sale/static/src/app/store/db.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/app/store/db.js b/addons/point_of_sale/static/src/app/store/db.js index 0cccdbd29c6..3b6ece3c689 100644 --- a/addons/point_of_sale/static/src/app/store/db.js +++ b/addons/point_of_sale/static/src/app/store/db.js @@ -102,7 +102,7 @@ export class PosDB { /* returns a list of all ancestors (parent, grand-parent, etc) categories ids * starting from the root category to the direct parent */ get_category_ancestors_ids(categ_id) { - return this.category_ancestors[categ_id] || []; + return this.category_ancestors[categ_id] || [this.root_category_id]; } /* returns the parent category's id of a category, or the root_category_id if no parent. * the root category is parent of itself. */