[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user