details: https://code.tryton.org/tryton/commit/fb4749715cb6
branch: default
user: Cédric Krier <[email protected]>
date: Thu Apr 23 00:56:02 2026 +0200
description:
Do not include _timestamp, _datetime nor __id in searched columns
Since 815a0a887c3e the history filtering is done using SQL query so
these
columns are no more needed in the search result.
diffstat:
trytond/trytond/model/modelsql.py | 13 -------------
1 files changed, 0 insertions(+), 13 deletions(-)
diffs (37 lines):
diff -r e29d66bccb77 -r fb4749715cb6 trytond/trytond/model/modelsql.py
--- a/trytond/trytond/model/modelsql.py Fri Jun 05 10:10:01 2026 +0200
+++ b/trytond/trytond/model/modelsql.py Thu Apr 23 00:56:02 2026 +0200
@@ -1904,12 +1904,6 @@
def __searched_columns(cls, tables, *, eager=False, history=False):
table, _ = tables[None]
columns = [table.id.as_('id')]
- if (cls._history and Transaction().context.get('_datetime')
- and (eager or history)):
- columns.append(
- Coalesce(table.write_date, table.create_date).as_('_datetime'))
- columns.append(Column(table, '__id').as_('__id'))
-
if eager:
table_query = cls._is_table_query()
columns += [f.sql_column(tables, cls).as_(n)
@@ -1919,11 +1913,6 @@
and (not table_query or n not in _TABLE_QUERY_COLUMNS)
and not getattr(f, 'translate', False)
and f.loading == 'eager']
- if not table_query:
- sql_type = fields.Char('timestamp').sql_type().base
- columns += [Extract('EPOCH',
- Coalesce(table.write_date, table.create_date)
- ).cast(sql_type).as_('_timestamp')]
return columns
@classmethod
@@ -2027,8 +2016,6 @@
if no_cache is None:
no_cache = list(data.keys())
for k in no_cache[:]:
- if k in ('_timestamp', '_datetime', '__id'):
- continue
field = cls._fields[k]
if not getattr(field, 'datetime_field', None):
no_cache.remove(k)