lingo: don't crash sorting invoices that have no creation date (#37208)
This commit is contained in:
parent
0f0353266e
commit
226f93dbd7
|
@ -663,7 +663,8 @@ class Items(CellBase):
|
|||
return ctx
|
||||
ctx.update({'title': self.title, 'text': self.text})
|
||||
items = self.get_invoices(user=context['user'])
|
||||
items.sort(key=lambda i: i.creation_date, reverse=True)
|
||||
none_date = datetime.datetime(1900, 1, 1) # to avoid None-None comparison errors
|
||||
items.sort(key=lambda i: i.creation_date or none_date, reverse=True)
|
||||
ctx.update({'items': items})
|
||||
return ctx
|
||||
|
||||
|
|
Loading…
Reference in New Issue