Date Range
date_range · OCA/server-ux
OCA/server-tools 9.0–10.0 → OCA/server-ux 11.0–20.0
Health
95/100
good
-
Security25/25No findings
-
Activity25/25Last human commit 1 month ago
-
Required by20/252 modules depend on it
-
Maturity25/25In 12 Odoo series since 9.0
Heuristic over the facts below, not an audit · How it's computed
Required by
2
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
LGPL-3
No conflicts with its dependencies
Folder size
2.31 MB
Module directory on disk
Code analysis
0 migration notes
4 models
7 views
0 HTTP endpoints
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.
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- account_tax_balance, mis_builder
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
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=True -
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=True
-
get_domain(self, field_name)
New fields (10)
-
company_idMany2one → res.companycomodel_name='res.company'compute='_compute_company_id'readonly=Falsestore=True -
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=True -
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=1 -
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…
Loading…