From 3cbb0efb43fac98030e3c22382047df1ca4e599e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 17 Aug 2023 16:18:21 +0200 Subject: [PATCH] Order by descending id to get the last 10 purchases Closes #12497 --- modules/purchase/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/purchase/purchase.py b/modules/purchase/purchase.py index 6411bc5805..0629ab68ee 100644 --- a/modules/purchase/purchase.py +++ b/modules/purchase/purchase.py @@ -421,7 +421,7 @@ class Purchase( table.invoice_method, where=(table.party == self.party.id) & (table.invoice_party == invoice_party), - order_by=table.id, + order_by=table.id.desc, limit=10) cursor.execute(*subquery.select( subquery.currency,