issue12497.diff [purchase] Use the last 10 purchases to set default currency, payment term and invoice method

This commit is contained in:
Raimon Esteve 2023-09-06 16:02:26 +02:00
parent cfbc276b9e
commit d01838d807
2 changed files with 15 additions and 0 deletions

13
issue12497.diff Normal file
View File

@ -0,0 +1,13 @@
diff --git a/tryton/modules/purchase/purchase.py b/tryton/modules/purchase/purchase.py
index ae946a3d5c..faf35cecfa 100644
--- a/tryton/modules/purchase/purchase.py
+++ b/tryton/modules/purchase/purchase.py
@@ -424,7 +424,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,

2
series
View File

@ -49,3 +49,5 @@ merge_request581.diff # [account] Post cancelled, grouped, rescheduled and deleg
issue12216.diff # [stock] Handle evaluation error of cost price in cost price revision
issue12480.diff # [trytond] Support GIN index with btree_gin PostgreSQL extension
issue12497.diff # [purchase] Use the last 10 purchases to set default currency, payment term and invoice method