Filters & Date Ranges

Updated 10 July 2026

Control which records appear using Domain filters, rolling date windows, and optional JSON context.

Overview

The Domain field on each template decides which rows are loaded when you Open data, export files, or send email. It uses the same visual domain editor as elsewhere in Odoo (pick fields, operators, and values). The stored value is evaluated with safe_eval at runtime, so advanced templates can use Python helpers for rolling periods (this month, last month, etc.).

Optional Context (JSON) passes extra keys into the window action-commonly group_by for default grouping in list or graph views.

How it works

On save, the module validates that the domain expression parses and evaluates against the template model. At run time, advance.report.runtime evaluates the domain in the user’s environment (respecting record rules and company context), then opens or exports matching records.

Rolling date domains

Demo templates such as [Studio demo] Sales – orders this calendar month (rolling) store domains using datetimedateutil.relativedelta, and server “today” so the window moves automatically-no manual date edits each month.

Context (JSON)

Must be a valid JSON object (e.g. {"group_by": "country_id"}). Invalid JSON blocks save. Context merges into the action when opening the report and can interact with pivot/graph settings.

Step-by-step

Fields reference

Field explanations

Each block matches one row in the table above, in the same order.

Tips

Common mistakes

Image

Filters & Date Ranges