[FIX] point_of_sale: properly filter the orders to load

filtered method doesn't mutate the recordset, thus, we should reassign to
have the new set of desired records.

closes odoo/odoo#116667

X-original-commit: 7cca8011e0f97a2db00c769b8f629506eca6cbdd
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
Joseph Caburnay
2023-03-27 13:48:09 +02:00
parent 35e333822d
commit 3ec3bebcbf
+1 -1
View File
@@ -1198,7 +1198,7 @@ class PosOrder(models.Model):
# As we cannot use currency_id in the domain (because it is not a stored field),
# we must do it after the search.
pos_config = self.env['pos.config'].browse(config_id)
orders.filtered(lambda order: order.currency_id == pos_config.currency_id)
orders = orders.filtered(lambda order: order.currency_id == pos_config.currency_id)
orderlines = self.env['pos.order.line'].search(['|', ('refunded_orderline_id.order_id', 'in', orders.ids), ('order_id', 'in', orders.ids)])
# We will return to the frontend the ids and the date of their last modification