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
odoo/odoo:
- web
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 IDNameModelTypeStatus
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)
  • active Boolean
    compute='_compute_active' help='The active field allows you to hide the date range without removing it.' readonly=False store=True
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> index=True string='Company'
  • date_end Date
    required=True string='End date'
  • date_start Date
    required=True string='Start date'
  • name Char
    required=True translate=True
  • type_id Many2one → date.range.type
    check_company=True comodel_name='date.range.type' index=True ondelete='restrict' required=True string='Type'
Public methods (1)
  • get_domain(self, field_name)

New fields (10)
  • company_id Many2one → res.company
    comodel_name='res.company' compute='_compute_company_id' readonly=False store=True string='Company'
  • count Integer
    string='Number of ranges to generate'
  • date_end Date
    compute='_compute_date_end' readonly=False store=True args: 'End date'
  • date_start Date
    compute='_compute_date_start' readonly=False required=True store=True args: 'Start date'
  • duration_count Integer
    compute='_compute_duration_count' readonly=False required=True store=True args: 'Duration'
  • name_expr Text
    compute='_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=False store=True args: 'Range name expression'
  • name_prefix Char
    compute='_compute_name_prefix' readonly=False store=True args: 'Range name prefix'
  • range_name_preview Char
    compute='_compute_range_name_preview'
  • type_id Many2one → date.range.type
    comodel_name='date.range.type' compute='_compute_type_id' domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]" ondelete='cascade' readonly=False required=True store=True string='Type'
  • unit_of_time Selection
    compute='_compute_unit_of_time' readonly=False required=True store=True args: [(str(YEARLY), 'years'), (str(MONTHLY), 'months'), (str(WEEKLY), 'weeks'), (str(DAILY), 'days')]
Public methods (5)
  • 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_id Many2one → date.range
    comodel_name='date.range' compute='_compute_date_range_search_id' search='_search_date_range_search_id' string='Filter by period (technical field)'
Public methods (2)
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model
    Inject the dummy Many2one field in the search view
  • get_views(self, views, options=None)
    @api.model
    Adapt 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)
  • active Boolean
    default=True help='The active field allows you to hide the date range type without removing it.'
  • allow_overlap Boolean
    default=False help='If set, date ranges of same type must not overlap.'
  • autogeneration_count Integer
  • autogeneration_date_start Date
    help='Only applies when there are no date ranges of this type yet' string='Autogeneration Start Date'
  • autogeneration_unit Selection
    args: [(str(YEARLY), 'years'), (str(MONTHLY), 'months'), (str(WEEKLY), 'weeks'), (str(DAILY), 'days')]
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> index=1 string='Company'
  • date_range_ids One2many → date.range
    string='Ranges' args: 'date.range', 'type_id'
  • date_ranges_exist Boolean
    compute='_compute_date_ranges_exist'
  • duration_count Integer
    args: 'Duration'
  • name Char
    required=True translate=True
  • name_expr Text
    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.' args: 'Range name expression'
  • name_prefix Char
    args: 'Range name prefix'
  • range_name_preview Char
    compute='_compute_range_name_preview' store=True
  • unit_of_time Selection
    args: [(str(YEARLY), 'years'), (str(MONTHLY), 'months'), (str(WEEKLY), 'weeks'), (str(DAILY), 'days')]
Public methods (2)
  • autogenerate_ranges(self)
    @api.model
    Generate 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…