From 44d4c65560385d482084fda5550cbe2dff92620d Mon Sep 17 00:00:00 2001 From: "Victor Piryns (pivi)" Date: Tue, 18 Oct 2022 12:35:42 +0000 Subject: [PATCH] [FIX] point_of_sale: open POS sessions with restricted categories Current behaviour: We get a traceback when opening a POS session with restricted categories Expected behaviour: We should be able to start a POS session with restricted categories. Steps to reproduce: - Install POS - In POS global settings add any category in the restricted categories - Try opening a new POS session Reason for the problem: Incorrect domain right leaf, the reference field that is a pos.category is not de-referenced. Fix: Add `.ids` at the tail end of the record reference Affected versions: - 16.0 - master opw-3021490 closes odoo/odoo#103548 X-original-commit: 8c76afc161133b78239cf91d746a159d67f67c4e Signed-off-by: Grazioso Andrea (agr) Signed-off-by: Piryns Victor (pivi) --- addons/point_of_sale/models/pos_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_config.py b/addons/point_of_sale/models/pos_config.py index 749457aa5d4..c227c861656 100644 --- a/addons/point_of_sale/models/pos_config.py +++ b/addons/point_of_sale/models/pos_config.py @@ -495,7 +495,7 @@ class PosConfig(models.Model): # check if there's any product for this PoS domain = [('available_in_pos', '=', True)] if self.limit_categories and self.iface_available_categ_ids: - domain.append(('pos_categ_id', 'in', self.iface_available_categ_ids)) + domain.append(('pos_categ_id', 'in', self.iface_available_categ_ids.ids)) if not self.env['product.product'].search(domain): return { 'name': _("There is no products linked to your PoS"),