Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
56f114d
9.0 add date range Sorrento Delivery
lmignon Apr 29, 2016
de2eedc
[10.0][MIGRATION] Migrated module 'date_range' to V10
aesposito-onestein Oct 7, 2016
763272b
[REF] date_range: Use 'index' instead of 'select'
moylop260 Nov 14, 2016
7d214e1
[IMP] date_range: Several things
alexis-via Jul 11, 2017
e2321cd
[10.0][FIX][date_range] Periods of one day should be allowed (#947)
MiquelRForgeFlow Aug 23, 2017
e1c36f2
[MIG] date_range
etobella Oct 9, 2017
e7225b6
[MIG] date_range: Adapt JS to new framework
lmignon Oct 11, 2017
914b28e
Fix unlink date range type.
Mar 24, 2018
0fa0f75
[IMP] date_range: adapt to multicompany
MiquelRForgeFlow Mar 23, 2018
7cddcfa
[IMP] date_range: new README structure
lmignon Jun 28, 2018
7a65760
[IMP] date_range: Pass integration tests
pedrobaeza Jul 13, 2018
400f599
[12.0][MIG] date_range
astirpe Oct 1, 2018
1b3b389
eslint
astirpe Oct 2, 2018
94334df
[FIX] date_range: Remove useless post_install flag for tests
lmignon Oct 12, 2018
6c4e7d4
[MIG] date_range: Migration to 13.0
MiquelRForgeFlow Sep 30, 2019
8602e51
[MIG] date_range: Migration to 13.0: Fix JS
lmignon Oct 18, 2019
33e4194
[FIX] black, isort, eslint
lmignon Oct 18, 2019
5cc87ee
[FIX] date_range: Disable external dependency check
lmignon Oct 18, 2019
3ede6fb
pre-commit update
sbidoul Apr 22, 2020
46512ce
[FIX] date_range: Failed compute in required field
pedrobaeza Oct 6, 2020
d1f970c
[IMP] date_range: black, isort, prettier
feketemihai Oct 9, 2020
e79e375
[MIG] date_range: Migration to 14.0
feketemihai Oct 9, 2020
c394494
[FIX] typo: date_start field name
astirpe Oct 22, 2020
58a4a09
[FIX] date_range: Refactor component with Owl framework
fuentes73 Mar 17, 2021
01b0c17
[IMP] date_range: Improve unit test not raising warning.
feketemihai Mar 21, 2021
d44cc8e
[FIX] date_range: make the range selector work
Apr 15, 2021
1e54403
[IMP] date_range: fully automatic generation from date range types
StefanRijnhart May 20, 2021
f0164ce
[RFR] date_range: convert wizard onchange to stored compute methods
StefanRijnhart May 28, 2021
ba5dd76
[IMP] date_range: add a search mixin class
StefanRijnhart May 11, 2021
1c84988
[FIX] Do not break super() calls on fields_view_get()
astirpe Jul 6, 2021
8ecbf85
[FIX] date_range: Add comment to missing dependency for odoo_test_helper
joao-p-marques Jul 9, 2021
dd5b1b6
[FIX] invalid value when doing test
dzungtran89 Nov 26, 2021
d1d9812
[IMP] date_range: black, isort, prettier
dzungtran89 Nov 26, 2021
28d5cfb
[15.0][IMP] date_range: black, isort, prettier
JoanMForgeFlow Dec 17, 2021
06b1117
[15.0][MIG] date_range:migration to version 15.0
JoanMForgeFlow Dec 17, 2021
86615b2
[MIG] date_range: Migration to 16.0
baimont Sep 1, 2022
5c805d3
[FIX] date_range: Remove a test requirement from install dependencies
etobella Mar 17, 2023
5498f63
date_range: AGPL -> LGPL
alexis-via Jun 16, 2023
93841f3
[FIX] date_range: Allow select date_ranges on custom filters
CarlosRoca13 Sep 4, 2023
cb60b82
[FIX] Avoid redefinition of this.OPERATORS as a new object
hugosantosred Sep 13, 2023
7f3d785
[FIX] date_range: Use FIELD_TYPES from this, as is already set
hugosantosred Sep 21, 2023
9a50db0
[FIX] date_range: prevent filters to be added multiple times
espo-tony Oct 20, 2023
731675f
Fixed pre-commit
espo-tony Oct 20, 2023
2a9e6eb
date_range: use _check_company_auto
alexis-via Nov 3, 2023
3b94b0b
date_range: fix string
alexis-via Nov 3, 2023
f2e3fb0
date_range: add search views for date.range and date.range.type
alexis-via Nov 3, 2023
f0dd07e
[IMP] date_range: refactor calls to deprecated functions
bosd Nov 4, 2023
adfb30f
[IMP] date_range: refactor calls to deprecated functions
bosd Nov 21, 2023
558c496
[IMP] date_range: pre-commit auto fixes
ramiadavid Nov 26, 2023
820ac26
[MIG] date_range: Migration to 17.0
ramiadavid Nov 26, 2023
77840eb
[UPD] Update date_range.pot
Jan 8, 2024
53447e3
[BOT] post-merge updates
OCA-git-bot Jan 8, 2024
bc8e76a
Update translation files
weblate Feb 3, 2024
e509636
Translated using Weblate (Italian)
mymage Feb 14, 2024
50c33c9
Translated using Weblate (French)
vincent-hatakeyama May 23, 2024
e938eca
[FIX] date_range: fix Translated stored related field warning
ramiadavid May 12, 2024
ec8dce6
[UPD] Update date_range.pot
Jun 4, 2024
a7fd023
[BOT] post-merge updates
OCA-git-bot Jun 4, 2024
7788ea7
Update translation files
weblate Jun 4, 2024
53ccd92
[FIX] date_range: fix README image urls
amincheloh Jun 8, 2024
4d82c78
Translated using Weblate (Swedish)
jakobkrabbe Jun 12, 2024
fa857a7
[BOT] post-merge updates
OCA-git-bot Jun 24, 2024
b9f34b2
[FIX] date_range: fix web ribbon
DavidJForgeFlow Jul 3, 2024
df4ea7a
[BOT] post-merge updates
OCA-git-bot Jul 3, 2024
6b91e5f
Translated using Weblate (Chinese (Simplified) (zh_CN))
xtanuiha Aug 27, 2024
5a8f40c
Translated using Weblate (Italian)
mymage Aug 30, 2024
d5c2622
Translated using Weblate (Spanish (Argentina))
ibuioli Oct 6, 2024
769779f
date_range: fix for cases when domain is not initialized
henrybackman Oct 8, 2024
4ec07c9
[BOT] post-merge updates
OCA-git-bot Oct 11, 2024
fafbdeb
[IMP] date_range: pre-commit stuff
BertVGroenendael Oct 15, 2024
8336cd4
[18.0][MIG] date_range: Migration to 18.0
BertVGroenendael Nov 4, 2024
8e1f1c0
[UPD] Update date_range.pot
Nov 19, 2024
2cec7cd
[BOT] post-merge updates
OCA-git-bot Nov 19, 2024
7ddbce8
Update translation files
weblate Nov 19, 2024
f05f5a0
Translated using Weblate (Italian)
mymage Jan 27, 2025
043b42c
Translated using Weblate (Italian)
mymage May 12, 2025
52714df
Translated using Weblate (Turkish)
metingulsoy Jul 22, 2025
a8be2e1
[IMP] date_range: pre-commit execution
rov-adhoc Nov 5, 2025
a5f6bfa
[MIG] date_range: Migration to 19.0
rov-adhoc Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 193 additions & 0 deletions date_range/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========
Date Range
==========

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:26156f1d5b0f8d700a7fa2a8a81ce509bfa25d8eb261aefc72986f03e59ee04a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Mature
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/19.0/date_range
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-19-0/server-ux-19-0-date_range
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-ux&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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.

**Table of contents**

.. contents::
:local:

Installation
============

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

Configuration
=============

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:

|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"

.. |search_view| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/date_range/static/description/date_range_many2one_search_field.png

Usage
=====

To configure this module, you need to:

- Go to Settings > Technical > Date ranges > Date Range Types where you
can create types of date ranges.

|image1|

- Go to Settings > Technical > Date ranges > Date Ranges where you can
create date ranges.

|image2|

It's also possible to launch a wizard from the 'Generate Date Ranges'
menu.

|image3|

The wizard is useful to generate recurring periods. Set an end date
or enter the number of ranges to create.

|image4|

- Your date ranges are now available in the search filter for any date
or datetime fields

Date range types are proposed as a filter operator

|image5|

Once a type is selected, date ranges of this type are porposed as a
filter value

|image6|

And the dates specified into the date range are used to filter your
result.

|image7|

- 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.

|image8|

.. |image1| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/date_range/static/description/date_range_type_create.png
.. |image2| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/date_range/static/description/date_range_create.png
.. |image3| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/date_range/static/description/date_range_wizard.png
.. |image4| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/date_range/static/description/date_range_wizard_result.png
.. |image5| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/date_range/static/description/date_range_type_as_filter.png
.. |image6| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/date_range/static/description/date_range_as_filter.png
.. |image7| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/date_range/static/description/date_range_as_filter_result.png
.. |image8| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/date_range/static/description/date_range_type_autogeneration.png

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20date_range%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ACSONE SA/NV

Contributors
------------

- Laurent Mignon <laurent.mignon@acsone.eu>
- Alexis de Lattre <alexis.delattre@akretion.com>
- Miquel Raïch <miquel.raich@forgeflow.com>
- Andrea Stirpe <a.stirpe@onestein.nl>
- Stefan Rijnhart <stefan@opener.amsterdam>
- David Ramia <<@ramiadavid>>
- Son Ho <sonhd@trobz.com>
- Bert Van Groenendael <bert.vangroenendael@dynapps.eu>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-lmignon| image:: https://github.com/lmignon.png?size=40px
:target: https://github.com/lmignon
:alt: lmignon

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-lmignon|

This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/19.0/date_range>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions date_range/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
27 changes: 27 additions & 0 deletions date_range/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Date Range",
"summary": "Manage all kind of date range",
"version": "19.0.1.0.0",
"category": "Uncategorized",
"website": "https://github.com/OCA/server-ux",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"license": "LGPL-3",
"installable": True,
"depends": ["web"],
"data": [
"data/ir_cron_data.xml",
"security/ir.model.access.csv",
"security/date_range_security.xml",
"views/date_range_view.xml",
"wizard/date_range_generator.xml",
],
"assets": {
"web.assets_backend": [
"date_range/static/src/js/*",
],
},
"development_status": "Mature",
"maintainers": ["lmignon"],
}
12 changes: 12 additions & 0 deletions date_range/data/ir_cron_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record model="ir.cron" id="ir_cron_autocreate">
<field name="name">Auto-generate date ranges</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="active">True</field>
<field name="model_id" ref="model_date_range_type" />
<field name="state">code</field>
<field name="code">model.autogenerate_ranges()</field>
</record>
</odoo>
Empty file added date_range/i18n/.empty
Empty file.
Loading