changeset b4e64b5dc320 in modules/sale:default
details: https://hg.tryton.org/modules/sale?cmd=changeset;node=b4e64b5dc320
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:
sale.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (20 lines):
diff -r 8b6a5e8e8c2d -r b4e64b5dc320 sale.py
--- a/sale.py Thu Jul 09 10:21:06 2020 +0100
+++ b/sale.py Tue Jul 21 00:36:40 2020 +0200
@@ -14,6 +14,7 @@
Button
from trytond.pyson import If, Eval, Bool, PYSONEncoder
from trytond.transaction import Transaction
+from trytond.tools import sortable_values
from trytond.pool import Pool
from trytond.ir.attachment import AttachmentCopyMixin
@@ -880,7 +881,7 @@
keyfunc = partial(self._group_return_key, list(moves.values()))
Shipment = pool.get('stock.shipment.out.return')
moves = moves.items()
- moves = sorted(moves, key=keyfunc)
+ moves = sorted(moves, key=sortable_values(keyfunc))
shipments = []
for key, grouped_moves in groupby(moves, key=keyfunc):