From a49fae62ac7f2a50cb8dd678190fd147cccf250d Mon Sep 17 00:00:00 2001 From: "Pedram (PEBR)" Date: Wed, 29 Nov 2023 15:06:45 +0100 Subject: [PATCH] [FIX] point_of_sale: exclude internal reference in loaded products Previously, products loaded from the background included the internal reference in their displayed name. This behavior was due to the 'display_default_code' context, which prevents the inclusion of 'default_code' in the product name, not being utilized within the 'get_pos_ui_product_product_by_params' function. opw-3617195 closes odoo/odoo#145644 X-original-commit: b6c87e4c3451fbb554557be95788c8e1a5e0332f Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Pedram Bi Ria (pebr) --- addons/point_of_sale/models/pos_session.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/point_of_sale/models/pos_session.py b/addons/point_of_sale/models/pos_session.py index 7490a8b60fd..0290cd48e4e 100644 --- a/addons/point_of_sale/models/pos_session.py +++ b/addons/point_of_sale/models/pos_session.py @@ -2116,6 +2116,7 @@ class PosSession(models.Model): :param custom_search_params: a dictionary containing params of a search_read() """ params = self._loader_params_product_product() + self = self.with_context(**params['context']) # custom_search_params will take priority params['search_params'] = {**params['search_params'], **custom_search_params} products = self.env['product.product'].with_context(active_test=False).search_read(**params['search_params'])