Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] [MIG] date_range #535

Merged
merged 82 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
98ed906
9.0 add date range Sorrento Delivery
lmignon Apr 29, 2016
1240fc0
OCA Transbot updated translations from Transifex
oca-transbot May 1, 2016
9e284e0
[10.0][MIGRATION] Migrated module 'date_range' to V10
aesposito-onestein Oct 7, 2016
9a4427c
OCA Transbot updated translations from Transifex
oca-transbot Oct 15, 2016
9206965
[REF] date_range: Use 'index' instead of 'select'
moylop260 Nov 14, 2016
4c6488b
OCA Transbot updated translations from Transifex
oca-transbot Nov 19, 2016
53c052a
[IMP] date_range: Several things
alexis-via Jul 11, 2017
77c632b
OCA Transbot updated translations from Transifex
oca-transbot Jul 15, 2017
5360d33
[10.0][FIX][date_range] Periods of one day should be allowed (#947)
MiquelRForgeFlow Aug 23, 2017
5c1d00c
[MIG] date_range
etobella Oct 9, 2017
dc5d907
[MIG] date_range: Adapt JS to new framework
lmignon Oct 11, 2017
6357bd8
Fix unlink date range type.
Mar 24, 2018
5a91440
[IMP] date_range: adapt to multicompany
MiquelRForgeFlow Mar 23, 2018
92ed4ed
[IMP] date_range: new README structure
lmignon Jun 28, 2018
2f35caa
[UPD] README.rst
OCA-git-bot Jun 29, 2018
710920f
[UPD] Update date_range.pot
oca-travis Jun 29, 2018
03ebfac
Translated using Weblate (Arabic)
osoul Jun 30, 2018
7236bac
[IMP] date_range: Pass integration tests
pedrobaeza Jul 13, 2018
d82a6df
[UPD] README.rst
OCA-git-bot Aug 5, 2018
d8e8976
[UPD] Update date_range.pot
oca-travis Aug 8, 2018
f9f49c7
Translated using Weblate (Danish)
hhgabelgaard Sep 5, 2018
7e409b0
[12.0][MIG] date_range
astirpe Oct 1, 2018
d18a901
eslint
astirpe Oct 2, 2018
e668223
[UPD] README.rst
OCA-git-bot Oct 6, 2018
3425678
[FIX] date_range: Remove useless post_install flag for tests
lmignon Oct 12, 2018
cae74ee
[UPD] Update date_range.pot
oca-travis Nov 3, 2018
ad8e005
Update translation files
oca-transbot Dec 9, 2018
110eed9
Translated using Weblate (Italian)
primes2h Dec 19, 2018
64c3943
Translated using Weblate (Portuguese)
pedrocs-exo Jul 5, 2019
9923422
[UPD] README.rst
OCA-git-bot Jul 29, 2019
a9c69b1
Translated using Weblate (Portuguese)
pedrocs-exo Aug 14, 2019
1100cec
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 2, 2019
ef54cfe
[MIG] date_range: Migration to 13.0
MiquelRForgeFlow Sep 30, 2019
42122eb
[MIG] date_range: Migration to 13.0: Fix JS
lmignon Oct 18, 2019
2048193
[FIX] black, isort, eslint
lmignon Oct 18, 2019
00ae6f1
[FIX] date_range: Disable external dependency check
lmignon Oct 18, 2019
5309b18
[UPD] Update date_range.pot
oca-travis Oct 25, 2019
be844e6
[UPD] README.rst
OCA-git-bot Oct 25, 2019
8484572
Translated using Weblate (Portuguese (Brazil))
mileo Nov 25, 2019
a556faa
Update translation files
oca-transbot Dec 4, 2019
6c30aa5
Translated using Weblate (Chinese (Simplified))
dong-z Mar 21, 2020
42ea7cd
pre-commit update
sbidoul Apr 22, 2020
f74a0ea
[UPD] Eficent -> ForgeFlow
MiquelRForgeFlow Oct 1, 2020
33d1e40
[UPD] README.rst
OCA-git-bot Oct 1, 2020
7d4a695
[FIX] date_range: Failed compute in required field
pedrobaeza Oct 6, 2020
c6321e4
[IMP] date_range: black, isort, prettier
feketemihai Oct 9, 2020
5d96f02
[MIG] date_range: Migration to 14.0
feketemihai Oct 9, 2020
53eeb68
[UPD] Update date_range.pot
oca-travis Oct 15, 2020
9e67ae0
[UPD] README.rst
OCA-git-bot Oct 15, 2020
d23d53c
[FIX] typo: date_start field name
astirpe Oct 22, 2020
c42eba8
date_range 14.0.1.0.1
OCA-git-bot Oct 22, 2020
761d78c
[IMP] update dotfiles [ci skip]
OCA-git-bot Nov 1, 2020
10386fb
Translated using Weblate (French)
sbidoul Dec 13, 2020
eb14998
Translated using Weblate (Dutch)
tarteo Feb 11, 2021
7b07481
Translated using Weblate (Spanish)
anasuarez1 Mar 16, 2021
ad1d1a6
[FIX] date_range: Refactor component with Owl framework
fuentes73 Mar 17, 2021
e1b6a6f
[IMP] date_range: Improve unit test not raising warning.
feketemihai Mar 21, 2021
85708ae
date_range 14.0.2.0.0
OCA-git-bot Mar 21, 2021
55b0663
Translated using Weblate (French (France))
Yvesldff Apr 11, 2021
d341146
[FIX] date_range: make the range selector work
Apr 15, 2021
f2d5e85
date_range 14.0.2.0.1
OCA-git-bot Apr 16, 2021
ac07e35
Translated using Weblate (Dutch)
bosd Apr 18, 2021
b1a33d1
date_range 14.0.2.0.2
OCA-git-bot Apr 29, 2021
f65abef
[IMP] date_range: fully automatic generation from date range types
StefanRijnhart May 20, 2021
a931b5f
[RFR] date_range: convert wizard onchange to stored compute methods
StefanRijnhart May 28, 2021
0048ce3
[IMP] date_range: add a search mixin class
StefanRijnhart May 11, 2021
03530e2
[FIX] Do not break super() calls on fields_view_get()
astirpe Jul 6, 2021
28a23cf
[FIX] date_range: Add comment to missing dependency for odoo_test_helper
joao-p-marques Jul 9, 2021
b00bebb
[FIX] invalid value when doing test
dzungtran89 Nov 26, 2021
e09dcb5
[IMP] date_range: black, isort, prettier
dzungtran89 Nov 26, 2021
060754f
[UPD] Update date_range.pot
oca-travis Nov 27, 2021
d3f02ec
[UPD] README.rst
OCA-git-bot Nov 27, 2021
3787004
Update translation files
oca-transbot Nov 27, 2021
3ffd70f
[UPD] Update date_range.pot
oca-travis Nov 28, 2021
f0825a9
[UPD] README.rst
OCA-git-bot Nov 28, 2021
3efa26b
date_range 14.0.2.1.0
OCA-git-bot Nov 28, 2021
3412fe8
Update translation files
oca-transbot Nov 28, 2021
799f051
[15.0][IMP] date_range: black, isort, prettier
JoanMForgeFlow Dec 17, 2021
bb6eb68
[15.0][MIG] date_range:migration to version 15.0
JoanMForgeFlow Dec 17, 2021
987c262
[UPD] Update date_range.pot
Dec 17, 2021
bf0a488
[UPD] README.rst
OCA-git-bot Dec 17, 2021
0f0df38
[MIG] date_range: Migration to 16.0
baimont Sep 1, 2022
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
180 changes: 180 additions & 0 deletions date_range/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
==========
Date Range
==========

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/15.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-15-0/server-ux-15-0-date_range
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/250/15.0
:alt: Try me on Runbot

|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`:

.. code-block::

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:

.. figure:: https://raw.githubusercontent.com/OCA/server-tools/12.0/date_range/static/description/date_range_many2one_search_field.png
:scale: 80 %
:alt: Date range Many2one search field

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:

.. code-block::

_date_range_search_field = "invoice_date"

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.

.. figure:: https://raw.githubusercontent.com/OCA/server-tools/14.0/date_range/static/description/date_range_type_create.png
:scale: 80 %
:alt: Create a type of date range

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

.. figure:: https://raw.githubusercontent.com/OCA/server-tools/14.0/date_range/static/description/date_range_create.png
:scale: 80 %
:alt: Date range creation

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

.. figure:: https://raw.githubusercontent.com/OCA/server-tools/14.0/date_range/static/description/date_range_wizard.png
:scale: 80 %
:alt: Date range wizard

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

.. figure:: https://raw.githubusercontent.com/OCA/server-tools/14.0/date_range/static/description/date_range_wizard_result.png
:scale: 80 %
:alt: Date range wizard result

* 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

.. figure:: https://raw.githubusercontent.com/OCA/server-tools/14.0/date_range/static/description/date_range_type_as_filter.png
:scale: 80 %
:alt: Date range type available as filter operator

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

.. figure:: https://raw.githubusercontent.com/OCA/server-tools/14.0/date_range/static/description/date_range_as_filter.png
:scale: 80 %
:alt: Date range as filter value

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

.. figure:: https://raw.githubusercontent.com/OCA/server-tools/14.0/date_range/static/description/date_range_as_filter_result.png
:scale: 80 %
:alt: Date range as filter 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.

.. figure:: https://raw.githubusercontent.com/OCA/server-tools/14.0/date_range/static/description/date_range_type_autogeneration.png
:scale: 80 %
:alt: Configure a date range for auto-generaton

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20date_range%0Aversion:%2015.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 <[email protected]>
* Alexis de Lattre <[email protected]>
* Miquel Raïch <[email protected]>
* Andrea Stirpe <[email protected]>
* Stefan Rijnhart <[email protected]>

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/15.0/date_range>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions date_range/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import wizard
35 changes: 35 additions & 0 deletions date_range/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Date Range",
"summary": "Manage all kind of date range",
"version": "16.0.1.0.0",
"category": "Uncategorized",
"website": "https://github.com/OCA/server-ux",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"license": "AGPL-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/date_range.esm.js",
],
"web.assets_qweb": [
"date_range/static/src/xml/date_range.xml",
],
},
"development_status": "Mature",
"maintainers": ["lmignon"],
"external_dependencies": {
"python": ["odoo_test_helper"],
},
}
14 changes: 14 additions & 0 deletions date_range/data/ir_cron_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="numbercall">-1</field>
<field name="active">True</field>
<field name="doall" eval="False" />
<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