mirror of
https://gitlab.com/flectra-community/mis-builder.git
synced 2024-11-16 11:12:07 +00:00
[FIX] Update from old repo
This commit is contained in:
parent
4bbe398350
commit
67103b6265
@ -612,24 +612,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:
|
||||
|
Loading…
Reference in New Issue
Block a user