From 176bf1442b2e7b7ee55ea8901009e05d2d2afbef Mon Sep 17 00:00:00 2001 From: Andres Calle Date: Fri, 19 Mar 2021 04:13:27 +0000 Subject: [PATCH] [FIX] check number not assigned correctly When printing a check from a payment the check number wizard shows the number 1 for the next check... it should show the last check added one +1, it doesn't because it doesn't exclude the account.payments without checknumber. This fix excludes the account.payments without checknumber so that it doesn't shows "1" as the next check number when there are multiple new checks to be printed X-original-commit: adfb8299141cb8fe9883741c43871a51f849655e --- addons/account_check_printing/models/account_payment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_check_printing/models/account_payment.py b/addons/account_check_printing/models/account_payment.py index ea06a0a6c41..28d48cb7b58 100644 --- a/addons/account_check_printing/models/account_payment.py +++ b/addons/account_check_printing/models/account_payment.py @@ -123,6 +123,7 @@ class AccountPayment(models.Model): FROM account_payment payment JOIN account_move move ON movE.id = payment.move_id WHERE journal_id = %(journal_id)s + AND check_number IS NOT NULL ORDER BY check_number::INTEGER DESC LIMIT 1 """, {