[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) <agr@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
This commit is contained in:
Victor Piryns (pivi)
2022-10-19 18:06:53 +02:00
parent 7277275d06
commit 44d4c65560
+1 -1
View File
@@ -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"),