Author: |
Numigi |
License: |
LGPL-3 |
Branch: |
11.0-website_sale_sanitized |
Repository: |
Numigi/odoo-web-addons |
Dependencies: |
web,
and
web_contextual_search_favorite |
Languages: |
HTML (18, 2.7%),
JavaScript (102, 15.2%),
Markdown (49, 7.3%),
PO File (80, 11.9%),
Python (218, 32.5%),
and
XML (204, 30.4%) |
Other branches: |
11.0,
12.0,
12.0-web_list_column_text_align,
14.0,
TA#47984,
TA#48575,
and
TA#48575-1 |
<h1>Web Search Date Range</h1>
<p>This module adds the possibility to easily add contextual date range filters.</p>
<p>Contextual means that the filter does not need to be updated.
It always filters records based on the current date.</p>
<p>You may add one of these filters to your favorites or your dashboard and it will not need to be refreshed.</p>
<p><img src="static/description/partner_list.png?raw=true" alt="List View"></p>
<h2>Date Filters</h2>
<p>To edit the list of filters that appear in the search view of a model:</p>
<ul>
<li>Go to: Settings / Technical / User Interface / Date Filters</li>
</ul>
<p><img src="static/description/date_filters.png?raw=true" alt="Date Filters"></p>
<h2>Date Range Types</h2>
<p>A date range type is a contextual domain filter that can be used for any date or datetime field.</p>
<p>Currently, the following date range types are implemented:</p>
<ul>
<li>Before Today</li>
<li>Today</li>
<li>Next Fifteen Days</li>
<li>Previous Week</li>
<li>Current Week</li>
<li>Next Week</li>
<li>Previous Month</li>
<li>Current Month</li>
<li>Next Month</li>
<li>Previous Year</li>
<li>Current Year</li>
<li>Next Year</li>
</ul>
<p>To add a custom range type:</p>
<ul>
<li>Go to: Settings / Technical / User Interface / Date Ranges</li>
<li>Click on <code>Create</code>.</li>
<li>Enter a label for your range type.</li>
<li>Enter a domain filter for your new range type.</li>
</ul>
<p>The domain you enter must contain <code>{field}</code> instead of a field name.
This allows to make the range type reusable.</p>
<p>Example of domain for the filter Today:
<code>python
[
('{field}', '&gt;=', context_today().strftime('%Y-%m-%d')),
('{field}', '&lt;', (context_today() + relativedelta(days=1)).strftime('%Y-%m-%d')),
]
</code></p>
<h2>Weekly Date Ranges</h2>
<p>Weekly date ranges are implemented from monday to sunday.</p>
<p>If you prefer from sunday to saturday:</p>
<ul>
<li>Go to: Settings / Technical / User Interface / Date Range Types.</li>
<li>For each weekly range type:
<ol>
<li>Adapt the contextual domain.</li>
<li>Check the <code>No Update</code> checkbox.</li>
</ol></li>
</ul>
<h2>Contributors</h2>
<ul>
<li>Numigi (tm) and all its contributors (https://bit.ly/numigiens)</li>
</ul>