changeset 208de3ba798c in modules/account_payment_sepa:default
details:
https://hg.tryton.org/modules/account_payment_sepa?cmd=changeset;node=208de3ba798c
description:
Ensure values can be sorted
The values may contain None which is not orderable so we insert a third
argument before the value to prevent to compare None value against
others.
issue9381
review303881005
diffstat:
payment.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (22 lines):
diff -r 6e10d22625db -r 208de3ba798c payment.py
--- a/payment.py Tue Jul 07 23:56:09 2020 +0200
+++ b/payment.py Tue Jul 21 00:36:40 2020 +0200
@@ -19,7 +19,7 @@
from trytond.model.exceptions import AccessError
from trytond.pyson import Eval, If
from trytond.transaction import Transaction
-from trytond.tools import reduce_ids, grouped_slice
+from trytond.tools import reduce_ids, grouped_slice, sortable_values
from trytond import backend
from trytond.modules.account_payment.exceptions import ProcessError
@@ -268,7 +268,8 @@
Payment = pool.get('account.payment')
keyfunc = self.sepa_group_payment_key
# re-browse to align cache
- payments = Payment.browse(sorted(self.payments, key=keyfunc))
+ payments = Payment.browse(sorted(
+ self.payments, key=sortable_values(keyfunc)))
for key, grouped_payments in groupby(payments, key=keyfunc):
yield dict(key), list(grouped_payments)