From 8e81e008132ebbbdb2119f103995bff2d3bc3c99 Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Tue, 24 May 2022 13:13:33 +0000 Subject: [PATCH] [FIX] point_of_sale: get the archived products in pos UI for a refund Before this commit: If one of the PoS order lines' products were archived, when clicking on the "Refund", it wouldn't show any line and got an error. Steps to reproduce the first issue: - Install the' Point of Sale' module - Open a PoS session - Add a product to the order - Validate the order and close the session - Archive that product_product - Clear your browser cache - Open a new PoS session - click on the "Refund" You get an error, and it wouldn't show any order lines. Solution An archived product shouldn't be shown on the PoS UI, but it should be available for the refund if it exists in one of the order lines. So the solution is to modify the domain to get archived products if needed for the refund. opw-2849240 closes odoo/odoo#99965 X-original-commit: 084d3800f3cbd84941f0761c6668f959504f83cb Signed-off-by: Masereel Pierre --- addons/point_of_sale/models/pos_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_session.py b/addons/point_of_sale/models/pos_session.py index b8108b77998..df86a589ef9 100644 --- a/addons/point_of_sale/models/pos_session.py +++ b/addons/point_of_sale/models/pos_session.py @@ -1948,7 +1948,7 @@ class PosSession(models.Model): params = self._loader_params_product_product() # custom_search_params will take priority params['search_params'] = {**params['search_params'], **custom_search_params} - products = self.env['product.product'].search_read(**params['search_params']) + products = self.env['product.product'].with_context(active_test=False).search_read(**params['search_params']) if len(products) > 0: self._process_pos_ui_product_product(products) return products