TIP: You can type at any time to perform a new search.
Date Range
date_range · OCA/server-ux
- Repository
- OCA/server-ux · module folder · Try on Runboat
- Module version
- 1.0.0
- Category
- Uncategorized
- Folder size
- 3.39 MB
- License
- LGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/server-ux
- Last tracking update
- 2026-08-07 09:06:24
- Authors
- ACSONE SA/NV, Odoo Community Association (OCA)
- Maintainers
- ACSONE SA/NV, Odoo Community Association (OCA)
- Committers
- Rocío Vega, Weblate, OCA-git-bot, oca-ci
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- account_financial_report, account_tax_balance, date_range_account, datev_export_dtvf, ddmrp_adjustment, mis_builder
- Description
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.
Code Analysis ⓘ
Views touched (7)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
date_range_generator_view_form |
date.range.generator.form | date.range.generator | form | New |
view_date_range_form_view |
date.range.form | date.range | form | New |
view_date_range_list |
date.range.list | date.range | list | New |
view_date_range_search |
date.range | search | New | |
view_date_range_type_form_view |
date.range.type.form | date.range.type | form | New |
view_date_range_type_list |
date.range.type.list | date.range.type | list | New |
view_date_range_type_search |
date.range.type | search | New |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (4)
New fields (6)
-
activeBooleancompute='_compute_active'help='The active field allows you to hide the date range without removing it.'readonly=Falsestore=True -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>index=Truestring='Company' -
date_endDaterequired=Truestring='End date' -
date_startDaterequired=Truestring='Start date' -
nameCharrequired=Truetranslate=True -
type_idMany2one → date.range.typecheck_company=Truecomodel_name='date.range.type'index=Trueondelete='restrict'required=Truestring='Type'
-
get_domain(self, field_name)
New fields (10)
-
company_idMany2one → res.companycomodel_name='res.company'compute='_compute_company_id'readonly=Falsestore=Truestring='Company' -
countIntegerstring='Number of ranges to generate' -
date_endDatecompute='_compute_date_end'readonly=Falsestore=True args: 'End date' -
date_startDatecompute='_compute_date_start'readonly=Falserequired=Truestore=True args: 'Start date' -
duration_countIntegercompute='_compute_duration_count'readonly=Falserequired=Truestore=True args: 'Duration' -
name_exprTextcompute='_compute_name_expr'help='Evaluated expression. E.g. "\'FY%s\' % date_start.strftime(\'%Y%m%d\')"\nYou can use the Date types \'date_end\' and \'date_start\', as well as the \'index\' variable.'readonly=Falsestore=True args: 'Range name expression' -
name_prefixCharcompute='_compute_name_prefix'readonly=Falsestore=True args: 'Range name prefix' -
range_name_previewCharcompute='_compute_range_name_preview' -
type_idMany2one → date.range.typecomodel_name='date.range.type'compute='_compute_type_id'domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]"ondelete='cascade'readonly=Falserequired=Truestore=Truestring='Type' -
unit_of_timeSelectioncompute='_compute_unit_of_time'readonly=Falserequired=Truestore=True args: [(str(YEARLY), 'years'), (str(MONTHLY), 'months'), (str(WEEKLY), 'weeks'), (str(DAILY), 'days')]
-
action_apply(self, batch=False) -
generate_names(self, vals)Generate the names for the given intervals -
onchange_count(self)@api.onchange('count') -
onchange_date_end(self)@api.onchange('date_end') -
onchange_name_expr(self)@api.onchange('name_expr')Wipe the prefix if an expression is entered. The reverse is not implemented because we don't want to wipe the users' painstakingly crafted expressions by accident.
New fields (1)
-
date_range_search_idMany2one → date.rangecomodel_name='date.range'compute='_compute_date_range_search_id'search='_search_date_range_search_id'string='Filter by period (technical field)'
-
get_view(self, view_id=None, view_type='form', **options)@api.modelInject the dummy Many2one field in the search view -
get_views(self, views, options=None)@api.modelAdapt the label of the dummy search field Ensure the technical name does not show up in the Custom Filter fields list (while still showing up in the Export widget)
New fields (14)
-
activeBooleandefault=Truehelp='The active field allows you to hide the date range type without removing it.' -
allow_overlapBooleandefault=Falsehelp='If set, date ranges of same type must not overlap.' -
autogeneration_countInteger -
autogeneration_date_startDatehelp='Only applies when there are no date ranges of this type yet'string='Autogeneration Start Date' -
autogeneration_unitSelectionargs: [(str(YEARLY), 'years'), (str(MONTHLY), 'months'), (str(WEEKLY), 'weeks'), (str(DAILY), 'days')] -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>index=1string='Company' -
date_range_idsOne2many → date.rangestring='Ranges' args: 'date.range', 'type_id' -
date_ranges_existBooleancompute='_compute_date_ranges_exist' -
duration_countIntegerargs: 'Duration' -
nameCharrequired=Truetranslate=True -
name_exprTexthelp='Evaluated expression. E.g. "\'FY%s\' % date_start.strftime(\'%Y%m%d\')"\nYou can use the Date types \'date_end\' and \'date_start\', as well as the \'index\' variable.' args: 'Range name expression' -
name_prefixCharargs: 'Range name prefix' -
range_name_previewCharcompute='_compute_range_name_preview'store=True -
unit_of_timeSelectionargs: [(str(YEARLY), 'years'), (str(MONTHLY), 'months'), (str(WEEKLY), 'weeks'), (str(DAILY), 'days')]
-
autogenerate_ranges(self)@api.modelGenerate ranges for types with autogeneration settings -
onchange_name_expr(self)@api.onchange('name_expr')Wipe the prefix if an expression is entered. The reverse is not implemented because we don't want to wipe the users' painstakingly crafted expressions by accident.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…