[ADD] web_time_range_menu_custom

This commit is contained in:
Alexandre D. Díaz
2021-09-20 13:04:50 +02:00
committed by Carlos Roca
parent 266ed71fd0
commit 9dc3acb296
16 changed files with 1234 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" ?>
<template>
<t t-name="web_time_range_menu_custom.CustomZone">
<div class="d-flex">
<input type="number" min="1" t-att-id="field_value" class="o_input" />
<select t-att-id="field_type" class="o_input o_date_field_selector">
<option value="days">Day</option>
<option value="weeks">Week</option>
<option value="months">Month</option>
<option value="years">Year</option>
</select>
</div>
</t>
<t t-extend="web.TimeRangeMenu">
<t
t-jquery="div.dropdown-item-text:has(#time_range_selector)"
t-operation="after"
>
<div class="dropdown-item-text d-none" id="time_range_selector_custom">
<t t-call="web_time_range_menu_custom.CustomZone">
<t
t-set="field_value"
t-value="'date_field_selector_custom_value'"
/>
<t t-set="field_type" t-value="'date_field_selector_custom_type'" />
</t>
</div>
</t>
<t
t-jquery="div.dropdown-item-text:has(.o_comparison_checkbox)"
t-operation="after"
>
<div
class="dropdown-item-text d-none"
id="comparison_time_range_selector_custom"
>
<t t-call="web_time_range_menu_custom.CustomZone">
<t
t-set="field_value"
t-value="'date_field_selector_comparison_custom_value'"
/>
<t
t-set="field_type"
t-value="'date_field_selector_comparison_custom_type'"
/>
</t>
</div>
</t>
</t>
</template>