changeset 93a9cf8538c8 in modules/account_payment:default
details: 
https://hg.tryton.org/modules/account_payment?cmd=changeset;node=93a9cf8538c8
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 |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r aa1494dc7275 -r 93a9cf8538c8 payment.py
--- a/payment.py        Thu Jul 09 10:21:06 2020 +0100
+++ b/payment.py        Tue Jul 21 00:36:40 2020 +0200
@@ -13,6 +13,7 @@
 from trytond.rpc import RPC
 from trytond.tools import reduce_ids, grouped_slice, cursor_dict
 from trytond.transaction import Transaction
+from trytond.tools import sortable_values
 from trytond.wizard import Wizard, StateView, StateAction, Button
 from trytond.pool import Pool
 
@@ -522,7 +523,8 @@
                             line=payment.line.rec_name))
 
         groups = []
-        payments = sorted(payments, key=self._group_payment_key)
+        payments = sorted(
+            payments, key=sortable_values(self._group_payment_key))
         for key, grouped_payments in groupby(payments,
                 key=self._group_payment_key):
             def group():

Reply via email to