[FIX] Update from old repo

This commit is contained in:
Thomas Winteler 2021-06-11 07:50:40 +02:00 committed by OCA2FC Migrator Bot
parent 3acfe9edaf
commit 25d4c3bdd2

View File

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