speedup: indexes, caching

This commit is contained in:
Frederik Jaeckel 2023-02-26 22:49:21 +01:00
parent 86e6c33cc1
commit 624a5bff55
11 changed files with 352 additions and 32 deletions

View file

@ -10,6 +10,7 @@ from trytond.modules.currency.ir import rate_decimal
from trytond.transaction import Transaction
from decimal import Decimal
STATES = {
'readonly': Or(
Eval('state', '') != 'edit',
@ -187,3 +188,18 @@ class SecondCurrencyMixin:
return 2
# end SecondCurrencyMixin
class MemCacheIndexMx:
""" add index to 'create_date' + 'write_date'
"""
@classmethod
def __setup__(cls):
super(MemCacheIndexMx, cls).__setup__()
# add index
cls.write_date.select = True
cls.create_date.select = True
# end MemCacheIndexMx