From 5a57867a0c5bcf9efe5f109b937c8cb68a7e2575 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 (grafted from f71e3a79e0c9249616a59ef2f96e807b12af3a44) --HG-- branch : 6.0 --- 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 7d14103616..16507fe1d9 100644 --- a/modules/purchase/purchase.py +++ b/modules/purchase/purchase.py @@ -442,7 +442,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,