diff options
| author | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-05-25 18:11:02 +0000 |
|---|---|---|
| committer | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-06-04 19:32:42 +0000 |
| commit | be5a51a345b8986da0e19627260f64f984e11ae9 (patch) | |
| tree | 4a0b1e5b0bfdad3124718ccf8e67164b5bbe07dd /addons/web/static/src/xml/base.xml | |
| parent | 884ef9f7ee345ab1e940dbf88f4432b7e10f36e3 (diff) | |
[IMP] web: Comparison menu
This commit replaces the "time range menu" in the control panel by a new
component: the "comparison menu".
Its purpose is roughly the same: compare a period of data in a reporting
view with the previous period or the previous year.
Its implementation is a bit simpler: it will only appear if at least one
date filter is selected in the search view, and will suggest to compare
each selected date option with the previous period or the previous year.
Task ID: 2245719
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 63 |
1 files changed, 2 insertions, 61 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 6d71234a6c1..d5bdaf6ba6b 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -62,9 +62,8 @@ class="o_group_by_menu" fields="fields" /> - <TimeRangeMenu t-if="props.searchMenuTypes.includes('timeRange')" - class="o_time_range_menu" - fields="fields" + <ComparisonMenu t-if="props.searchMenuTypes.includes('comparison') and model.getFiltersOfType('comparison').length" + class="o_comparison_menu" /> <FavoriteMenu t-if="props.searchMenuTypes.includes('favorite')" class="o_favorite_menu" @@ -219,18 +218,6 @@ </xpath> </t> -<t t-name="web.TimeRangeMenu" t-inherit="web.DropdownMenu" t-inherit-mode="primary" owl="1"> - <xpath expr="//ul[@role='menu']/t[@t-foreach]" position="replace"> - <li class="o_menu_item dropdown-item-text" role="menuitem"> - <t t-if="fields.length" t-call="web.TimeRangeEditor"/> - <t t-else="">No date field available.</t> - </li> - <li class="o_menu_item dropdown-item-text" role="menuitem"> - <button type="button" class="btn btn-primary" t-on-click="_onApply">Apply</button> - </li> - </xpath> -</t> - <t t-name="web.DropdownMenuItem" owl="1"> <li class="o_menu_item" role="menuitem" t-on-keydown="_onKeydown"> <t t-if="canBeOpened"> @@ -641,52 +628,6 @@ </div> </t> -<t t-name="web.TimeRangeEditor" owl="1"> - <div class="o_time_range_editor"> - <div class="o_time_range_section"> - <label t-attf-for="field_select_{{ domId }}">Based On</label> - <select t-attf-id="field_select_{{ domId }}" class="o_input" t-model="state.fieldName"> - <option t-foreach="fields" t-as="field" t-key="field.name" - t-att-selected="state.fieldName === field.name" - t-att-value="field.name" - t-esc="field.description" - /> - </select> - </div> - <div class="o_time_range_section"> - <label t-attf-for="range_select_{{ domId }}">Range</label> - <select t-attf-id="range_select_{{ domId }}" class="o_input" t-model="state.rangeId"> - <optgroup t-foreach="periodGroups" t-as="group" t-key="group" label=""> - <t t-foreach="Object.values(periodOptions)" t-as="option" t-key="option_index"> - <option t-if="option.groupNumber === group" - t-att-selected="state.rangeId === option.id" - t-att-value="option.id" - t-esc="option.description" - /> - </t> - </optgroup> - </select> - </div> - <div class="o_time_range_section"> - <div class="custom-control custom-checkbox"> - <input type="checkbox" t-attf-id="checkbox_select_{{ domId }}" - class="custom-control-input" - t-att-checked="state.comparisonRangeId" - t-on-click="_onCheckboxClick" - /> - <label t-attf-for="checkbox_select_{{ domId }}" class="custom-control-label">Compare To</label> - </div> - <select t-if="state.comparisonRangeId" class="o_input" t-model="state.comparisonRangeId"> - <option t-foreach="Object.values(comparisonTimeRangeOptions)" t-as="option" t-key="option_index" - t-att-selected="state.comparisonRangeId === option.id" - t-att-value="option.id" - t-esc="option.description" - /> - </select> - </div> - </div> -</t> - <t t-name="web.ViewSwitcherButton" owl="1"> <button type="button" t-att-accesskey="view.accessKey" |
