[FIX] Update from old repo

This commit is contained in:
Thomas Winteler 2021-06-11 07:50:40 +02:00
parent 261529aac1
commit 7d43bea155

View File

@ -611,24 +611,25 @@ class MisReport(models.Model):
domain = query.domain and safe_eval(query.domain, eval_context) or [] domain = query.domain and safe_eval(query.domain, eval_context) or []
if get_additional_query_filter: if get_additional_query_filter:
domain.extend(get_additional_query_filter(query)) domain.extend(get_additional_query_filter(query))
if query.date_field.ttype == "date": if query.date_field.ttype:
domain.extend( if query.date_field.ttype == "date":
[ domain.extend(
(query.date_field.name, ">=", date_from), [
(query.date_field.name, "<=", date_to), (query.date_field.name, ">=", date_from),
] (query.date_field.name, "<=", date_to),
) ]
else: )
datetime_from = _utc_midnight(date_from, self._context.get("tz", "UTC")) else:
datetime_to = _utc_midnight( datetime_from = _utc_midnight(date_from, self._context.get("tz", "UTC"))
date_to, self._context.get("tz", "UTC"), add_day=1 datetime_to = _utc_midnight(
) date_to, self._context.get("tz", "UTC"), add_day=1
domain.extend( )
[ domain.extend(
(query.date_field.name, ">=", datetime_from), [
(query.date_field.name, "<", datetime_to), (query.date_field.name, ">=", datetime_from),
] (query.date_field.name, "<", datetime_to),
) ]
)
field_names = [f.name for f in query.field_ids] field_names = [f.name for f in query.field_ids]
all_stored = all([model._fields[f].store for f in field_names]) all_stored = all([model._fields[f].store for f in field_names])
if not query.aggregate: if not query.aggregate: