OdooWiki OCA HUB
Uncategorized License: LGPL-3

This module lets you define global date ranges that can be used to filter your values in tree views.

It also provides a mixin model for developers that extends the model's search view so that date ranges can be search as any relational field.

auto_awesome What this module does

AI-generated from the code · Odoo 20.0

Create and manage reusable date ranges (periods) in Odoo, and filter records by those periods in list views. Ranges can be grouped into types, generated automatically, and used as a 'Period' filter in search views.

This module adds a new area under the Custom menu called 'Date ranges' with three screens: Date Ranges, Date Range Types and Generate Date Ranges.

  • Date Ranges: each range has a name, a start date, an end date and a type. A range cannot end before it starts, and two ranges of the same type cannot overlap unless the type allows it. Ranges are unique per company and can be archived.
  • Date Range Types: define categories of periods (for example fiscal years or quarters). Each type can allow overlapping, and can carry defaults for automatic generation: a duration and unit (days, weeks, months, years), a name prefix or a name expression, and auto-generation settings (a start date plus how many units to create in advance).
  • Generate Date Ranges: a wizard that creates many ranges at once from a type, either until a given end date or for a chosen number of periods. Names are built from the prefix or from the expression, and a preview shows the first generated name.

A scheduled job ('Auto-generate date ranges') runs in the background to create future ranges for types that have auto-generation settings. The module also adds a 'Period' filter to search views of models that use the date range search mixin, letting users pick a saved range instead of typing dates. Access is read-only for regular users and full management for administrators, with multi-company rules.

Depends on

web

Menus it adds

Date rangesmenu_date_range_actionmenu_date_range_type_actionmenu_date_range_generator_action
Models and fields (4)
  • date.range · new modelname, active, type_id, date_end (End date), company_id, date_start (Start date)
  • date.range.type · new modelname, active, name_expr (Range name expression), company_id, name_prefix (Range name prefix), unit_of_time, allow_overlap, date_range_ids (Ranges), duration_count (Duration), date_ranges_exist, range_name_preview, autogeneration_unit, autogeneration_count, autogeneration_date_start (Autogeneration Start Date)
  • date.range.generator · new modelcount (Number of ranges to generate), type_id, date_end (End date), name_expr (Range name expression), company_id, date_start (Start date), name_prefix (Range name prefix), unit_of_time, duration_count (Duration), range_name_preview
  • date.range.search.mixin · new modeldate_range_search_id (Filter by period (technical field))

Text generated by AI (DeepSeek) from reading the Odoo 20.0 code on GitHub; it may contain mistakes, so check the code before deciding. The module is very large and only part of the code was read. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 9 confirmed, 0 with no information of 9 versions.

Sources · Odoo 16.0

Confirmed on 2026-11-03 in branch 16.0 of OCA/server-ux.

terminal Installation and usage

OCA documentation · Odoo 20.0

The addon use the daterange method from postgres. This method is supported as of postgresql 9.2

For regular usage, see Usage below. This section is to clarify optional functionality to developers.

To configure a model to use the Many2one style search field, make the model inherit from date.range.search.mixin:

class AccountMove(models.Model):
    _name = "account.move"
    _inherit = ["account.move", "date.range.search.mixin"]

This will make a Period field show up in the search view:

>

By default, the mixin works on the date field. If you want the mixin to work on a field with a different name, you can set a property on your model:

_date_range_search_field = "invoice_date"

To configure this module, you need to:

  • Go to Settings \> Technical \> Date ranges \> Date Range Types where you can create types of date ranges.
  • Go to Settings \> Technical \> Date ranges \> Date Ranges where you can create date ranges. It's also possible to launch a wizard from the 'Generate Date Ranges' menu. The wizard is useful to generate recurring periods. Set an end date or enter the number of ranges to create. The duration, the unit of time, the name prefix and the start date are taken from the date range type.
  • Your date ranges are now available in the custom filter for any date or datetime fields Date range types are proposed as a filter operator ("in \"). Once a type is selected, date ranges of this type are proposed as a filter value And the dates specified into the date range are used to filter your result.
  • You can configure date range types with default values for the generation wizard on the Generation tab. In the same tab you can also configure date range types for auto-generation. New ranges for types configured for this are generated by a scheduled task that runs daily.
info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.