summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2018-06-12 17:11:13 +0200
committerAdrien Dieudonne <adr@odoo.com>2018-07-06 14:09:09 +0200
commit097464de6f85020ad1e56bbc253837a7d60e47e4 (patch)
treea33c5fbe25cedfd2b0ac378b13ac2d47f38f393b /addons/web/static/src/xml
parent9756109e670cef01b4d475c8cb6687fecdab2cd2 (diff)
[IMP] web: easy selection of a period in filters menu
This commit allow to create easily a range of periods (related to a field of date or datetime type) to select in the filters menu. Two new attributes on elements with tag 'filter' are now usable in combination in a search view arch: - date: string. A valid field name with associated type date or datetime - default_period: string (optional). To choose in the following list: - 'today' - 'this_week' - 'this_month' (default) - 'this_quarter' - 'this_year' - 'yesterday' - 'last_week' - 'last_month' - 'last_quarter' - 'last_year' - 'last_7_days' - 'last_30_days' - 'last_365_days' Example: <filter string="Creation Date" name="period_generator" date="create_date" default_period="this_quarter"/> Note: the attribute 'domain' can not be used for such filters. The generated domains are dynamic and can be saved as such via the favorites menu.
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/base.xml9
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index a4714e81ee5..758f5bcd416 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1055,14 +1055,19 @@
<a href="#">
<t t-esc="item.description"/>
<span t-if="item.isRemovable" t-att-data-id="item.itemId" class="o_trash_button" > <span class="fa fa-trash-o"></span> </span>
- <span t-if="item.hasOptions" t-att-data-id="item.itemId" class="o_submenu_switcher"> <span class="fa fa-caret-down"></span> </span>
+ <span t-if="item.hasOptions" t-att-data-id="item.itemId" class="o_submenu_switcher">
+ <span t-att-class="item.isOpen ? 'fa fa-caret-down' : 'fa fa-caret-right'"></span>
+ </span>
</a>
<ul t-if="item.hasOptions &amp;&amp; item.isOpen">
+ <t t-set="subgroup" t-value="0"/>
<t t-foreach="_.values(item.options)" t-as="option">
+ <li t-if="subgroup !== option.groupId" class="divider" data-removable="1"/>
<li t-att-class="'o_item_option ' + (item.currentOptionId === option.optionId ? 'selected': '')"
t-att-data-item_id="item.itemId" t-att-data-option_id="option.optionId">
<a href="#"><t t-esc="option.description"/></a>
</li>
+ <t t-set="subgroup" t-value="option.groupId"/>
</t>
</ul>
</li>
@@ -1145,7 +1150,7 @@
<div class="fa fa-sm fa-remove o_facet_remove" role="img" aria-label="Remove" title="Remove"/>
</div>
<span t-name="SearchView.FacetView.Value">
- <t t-esc="widget.model.get('label') + (widget.intervalLabel ? (': ' + widget.intervalLabel) : '')"/>
+ <t t-esc="widget.model.get('label') + (widget.optionLabel ? (': ' + widget.optionLabel) : '')"/>
</span>
<t t-name="SearchView.autocomplete">
<ul class="dropdown-menu o_searchview_autocomplete" role="menu"></ul>