diff --git a/trytond/CHANGELOG b/trytond/CHANGELOG index e2d2a1f6cc..61d96e8376 100644 --- a/trytond/CHANGELOG +++ b/trytond/CHANGELOG @@ -1,3 +1,4 @@ +* Use the FILTER syntax with SQL aggregate functions * Use the EXISTS operator when using the 'where' operator in Many2One * Redact sensitive values from the log (issue14220) * Add multiple attribute to the buttons in the tree view diff --git a/trytond/trytond/backend/postgresql/database.py b/trytond/trytond/backend/postgresql/database.py index 4e6cfd2e0c..2692207d6a 100644 --- a/trytond/trytond/backend/postgresql/database.py +++ b/trytond/trytond/backend/postgresql/database.py @@ -205,7 +205,7 @@ class Database(DatabaseInterface): _has_proc = defaultdict(lambda: defaultdict(dict)) _extensions = defaultdict(dict) _search_full_text_languages = defaultdict(dict) - flavor = Flavor(ilike=True) + flavor = Flavor(ilike=True, filter_=True) TYPES_MAPPING = { 'SMALLINT': SQLType('INT2', 'INT2'), diff --git a/trytond/trytond/backend/sqlite/database.py b/trytond/trytond/backend/sqlite/database.py index 6a0928eb3a..c9a5c4a791 100644 --- a/trytond/trytond/backend/sqlite/database.py +++ b/trytond/trytond/backend/sqlite/database.py @@ -444,7 +444,8 @@ class Database(DatabaseInterface): _list_cache_timestamp = {} flavor = Flavor( paramstyle='qmark', function_mapping=MAPPING, null_ordering=False, - max_limit=-1) + max_limit=-1, + filter_=sqlite.sqlite_version_info >= (3, 30, 0)) IN_MAX = 200 TYPES_MAPPING = {