[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 <pim@odoo.com>
This commit is contained in:
pedrambiria
2022-09-10 11:55:21 +02:00
parent db7322c260
commit 8e81e00813
+1 -1
View File
@@ -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