Error in data.py, Method SortInvoice.sort_lines
File data.py; Class SortInvoice; Method sort_lines: When comparing Datetime instances the case of a None-Value is not checked and Tryton throws an arrow, see log below:
[19.05.2024 08:24:23] DEBUG:trytond.modules.sort_invoice_grouping.invoice:sortinvoicelines: unsorted
id | seq | sale_date | ship_date | description
------+-----+------------+------------+------------
1 | 0 | 2024-05-19 | None | n.a.
2 | 0 | 2024-05-19 | 2024-05-19 | Musterartikel
Traceback (most recent call last):
File "/home/mst/TRYTON/Vers7.0test2/lib/python3.9/site-packages/trytond/protocols/dispatcher.py", line 196, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/home/mst/TRYTON/Vers7.0test2/lib/python3.9/site-packages/trytond/model/modelview.py", line 742, in wrapper
return func(cls, records, *args, **kwargs)
File "/home/mst/TRYTON/Vers7.0test2/lib/python3.9/site-packages/trytond/modules/sort_invoice_grouping/invoice.py", line 36, in sort_lines
sortinvoice.sort_lines()
File "/home/mst/TRYTON/Vers7.0test2/lib/python3.9/site-packages/trytond/modules/sort_invoice_grouping/data.py", line 213, in sort_lines
if self.lines[i].shipping_date > \
TypeError: '>' not supported between instances of 'NoneType' and 'datetime.date'
Further explanation in German:
Wenn man im Verkauf einen Artikel manuell anlegt, d.h. er wird nicht aus Products entnommen, dann taucht dieser Artikel nicht in der Lieferung auf und erhält somit kein Lieferdatum. In der Rechnung wird der Artikel jedoch eingetragen und löst dann den oben beschriebenen Fehler aus.