[FIX] point_of_sale: reverse order of paid orders to match backend

This commit modifies the `search_paid_order_ids` function to reverse
the order of fetched orders before returning them. The change ensures
that the order of fetched orders aligns with the sorting order of the
backend, providing a consistent and expected display of data on
the frontend.

opw-3462740

closes odoo/odoo#132253

X-original-commit: 92066ea0ae2e1da7dce18d173638a9695c73e31b
Signed-off-by: David Monnom (moda) <moda@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
Pedram (PEBR)
2023-08-18 14:25:38 +02:00
parent c8e83a894a
commit 80bff89cb3
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1081,7 +1081,7 @@ class PosOrder(models.Model):
if orders_info[key_order] < orderline.write_date:
orders_info[key_order] = orderline.write_date
totalCount = self.search_count(real_domain)
return {'ordersInfo': list(orders_info.items()), 'totalCount': totalCount}
return {'ordersInfo': list(orders_info.items())[::-1], 'totalCount': totalCount}
def _export_for_ui(self, order):
timezone = pytz.timezone(self._context.get('tz') or self.env.user.tz or 'UTC')
@@ -98,8 +98,8 @@ registry
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectFilter("Paid");
TicketScreen.check.nthRowContains(3, "Brandon Freeman");
TicketScreen.check.nthRowContains(2, "-0005");
TicketScreen.check.nthRowContains(2, "Brandon Freeman");
TicketScreen.check.nthRowContains(3, "-0005");
// Invoice order
TicketScreen.do.selectOrder("-0005");
TicketScreen.check.orderWidgetIsNotEmpty();