[FIX] point_of_sale: fix restrict categories bug

The products are not correctly loaded in the POS because of a bug
regarding the `Restrict Categories` feature.

Steps to reproduce:

1. Create a `pos config` with `Restrict Categories` set to: `categ1` and `categ2`

2. Disable `Restrict Categories`

3. Open the POS and notice that although all the categories are present in the
	category selector, only the products from `categ1` and `categ2` are loaded.

closes odoo/odoo#134645

Task: 3497308
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
vlst
2023-09-07 11:46:15 +00:00
parent c5ece6ccc1
commit 78f77a89a4
+1 -1
View File
@@ -663,7 +663,7 @@ class PosConfig(models.Model):
('available_in_pos', '=', True),
('sale_ok', '=', True),
]
if self.iface_available_categ_ids:
if self.limit_categories and self.iface_available_categ_ids:
domain.append(('pos_categ_ids', 'in', self.iface_available_categ_ids.ids))
if self.iface_tipproduct:
domain = OR([domain, [('id', '=', self.tip_product_id.id)]])