problem in default_fiscalyear() in module account
Noticing relatively frequently the following in the logs:
ERROR:trytond.protocols.dispatcher:account.general_ledger.account.party.search_count([[['account', '=', 1127]], []], 0, 100, {'client': 'e92cb57c-4ea6-45cb-b647-214 [truncated]...) from xxxxx@192.168.0.42/xxxx/ in 2 ms
Traceback (most recent call last):
File "/opt/trytond/trytond/protocols/dispatcher.py", line 204, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/model/modelstorage.py", line 569, in search_count
res = cls.search(
^^^^^^^^^^^
File "/opt/trytond/trytond/model/modelsql.py", line 1728, in search
tables, expression = cls.__search_query(domain, count, query, order)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/model/modelsql.py", line 1647, in __search_query
tables, expression = cls.search_domain(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/model/modelsql.py", line 1846, in search_domain
tables[None] = (cls.__table__(), None)
^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/model/modelsql.py", line 347, in __table__
return cls.table_query()
^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/account/account.py", line 1910, in table_query
context = LedgerAccountContext.get_context()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/account/account.py", line 2272, in get_context
return cls.default_get(fields_names, with_rec_name=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/model/model.py", line 149, in default_get
value[field_name] = cls._defaults[field_name]()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/trytond/trytond/modules/account/account.py", line 2190, in default_fiscalyear
if context.get('fiscalyear', -1) >= 0:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
running recent 6.8 on python 3.11.3