From ab8615eed541ca655a5426ac9cd2913e9dd291af Mon Sep 17 00:00:00 2001 From: Preksha Chouhan Date: Wed, 3 May 2023 08:47:05 +0000 Subject: [PATCH] [FIX] point_of_sale: prevent traceback while creating new pos category When user create a pos category from 'restaurant.printer' model in 'pos_restaurant' module. it will give an error with the message - 'sequence item 0: expected str instance, bool found' Steps to Produce:- 1. Install 'pos_restaurant' module 2. Go to 'point_of_sale' module 3. Go to 'Configuration' -> 'Order Printers' 4. Click on any printer or create new 5. Under 'Printed Product Categories' click 'Add a line' 6. Click 'New' Trace-back will be generated. Applying these changes will resolve this issue. sentry - 4072172292 closes odoo/odoo#123247 X-original-commit: c99090d4b70f293d3784c19511d0a1f3078e3d9c Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Preksha Chouhan (prec) --- addons/point_of_sale/models/pos_category.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_category.py b/addons/point_of_sale/models/pos_category.py index c2b1fb8a8eb..7e477dc5248 100644 --- a/addons/point_of_sale/models/pos_category.py +++ b/addons/point_of_sale/models/pos_category.py @@ -31,7 +31,7 @@ class PosCategory(models.Model): res.append(cat.name) cat = cat.parent_id return res - return [(cat.id, " / ".join(reversed(get_names(cat)))) for cat in self] + return [(cat.id, " / ".join(reversed(get_names(cat)))) for cat in self if cat.name] @api.ondelete(at_uninstall=False) def _unlink_except_session_open(self):