2
0
account-financial-tools/account_journal_general_sequence/models
Jairo Llopis 1067d0ea1b
[FIX] account_journal_general_sequence: provide defaults for sorting
Under some weird scenarios where some modules are involved, several invoices are posted at the same time, and no invoice exists, we could get to the case when `one.date` or `one.name` were `False`.

Here I provide a default value to avoid comparing `str` to `bool` in those cases.

Tried a lot but couldn't reproduce the test case in code, sorry 😕. However, the traceback was clear:

```
File "/opt/odoo/auto/addons/account_journal_general_sequence/models/account_move.py", line 64, in _compute_entry_number
  for move in chosen.sorted(lambda one: (one.date, one.name, one.id)):
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5583, in sorted
  ids = tuple(item.id for item in sorted(self, key=key, reverse=reverse))
TypeError: '<' not supported between instances of 'str' and 'bool'
```

@moduon MT-5559
2024-03-25 10:51:45 +00:00
..
__init__.py [ADD] account_journal_general_sequence: account move entry sequence 2022-12-23 10:22:43 +00:00
account_journal.py [FIX] account_journal_general_sequence: fix multicompany 2023-06-28 11:28:23 +01:00
account_move_line.py [ADD] account_journal_general_sequence: account move entry sequence 2022-12-23 10:22:43 +00:00
account_move.py [FIX] account_journal_general_sequence: provide defaults for sorting 2024-03-25 10:51:45 +00:00