mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_time_range_menu_custom: Migration to 17.0
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
{
|
||||
"name": "Web Time Range Menu Custom",
|
||||
"version": "16.0.1.0.0",
|
||||
"version": "17.0.1.0.0",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
"license": "AGPL-3",
|
||||
"website": "https://github.com/OCA/web",
|
||||
@@ -11,7 +11,11 @@
|
||||
"auto_install": False,
|
||||
"assets": {
|
||||
"web.assets_backend": [
|
||||
"/web_time_range_menu_custom/static/src/js/*.esm.js",
|
||||
(
|
||||
"after",
|
||||
"/web/static/src/search/utils/dates.js",
|
||||
"/web_time_range_menu_custom/static/src/js/*.esm.js",
|
||||
),
|
||||
"/web_time_range_menu_custom/static/src/scss/*.scss",
|
||||
"/web_time_range_menu_custom/static/src/xml/*.xml",
|
||||
],
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/** @odoo-module **/
|
||||
/* Copyright 2024 Tecnativa - Carlos Roca
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
|
||||
import {ComparisonMenu} from "@web/search/comparison_menu/comparison_menu";
|
||||
import {DropdownItemCustomPeriod} from "./date_selector.esm";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
|
||||
patch(ComparisonMenu, "web_time_range_menu_custom.FilterMenu", {
|
||||
components: {
|
||||
...ComparisonMenu.components,
|
||||
DropdownItemCustomPeriod,
|
||||
},
|
||||
});
|
||||
@@ -40,7 +40,7 @@ Object.assign(dates.PER_YEAR, {
|
||||
const _getSetParam = dates.getSetParam;
|
||||
|
||||
// Patch of functions defined before
|
||||
patch(dates, "patch dates", {
|
||||
patch(dates, {
|
||||
/*
|
||||
* Redefine function to avoid the exclusion of days and weeks.
|
||||
*/
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/** @odoo-module **/
|
||||
/* Copyright 2024 Tecnativa - Carlos Roca
|
||||
/* Copyright 2022 Tecnativa - Carlos Roca
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
|
||||
import {FilterMenu} from "@web/search/filter_menu/filter_menu";
|
||||
import {DropdownItemCustomPeriod} from "./date_selector.esm";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
import {SearchBarMenu} from "@web/search/search_bar_menu/search_bar_menu";
|
||||
import {DropdownItemCustomPeriod} from "./date_selector.esm";
|
||||
|
||||
patch(FilterMenu, "web_time_range_menu_custom.FilterMenu", {
|
||||
patch(SearchBarMenu, {
|
||||
components: {
|
||||
...FilterMenu.components,
|
||||
...SearchBarMenu.components,
|
||||
DropdownItemCustomPeriod,
|
||||
},
|
||||
});
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-inherit="web.ComparisonMenu" t-inherit-mode="extension" owl="1">
|
||||
<xpath expr="//t[@t-foreach='items']" position="after">
|
||||
<DropdownItemCustomPeriod comparisonItems="items" type="'comparison'" />
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="web_time_range_menu_custom.DropdownItemCustomPeriod" owl="1">
|
||||
<t t-name="web_time_range_menu_custom.DropdownItemCustomPeriod">
|
||||
<div class="o_menu_item dropdown-item" data-id="__computed__">
|
||||
<a href="#" role="menuitem" t-on-click="onClickCustomPeriod">
|
||||
Custom period
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-inherit="web.FilterMenu" t-inherit-mode="extension" owl="1">
|
||||
<xpath
|
||||
expr="//t[@t-if='item.options']//t[@t-foreach='item.options']"
|
||||
position="after"
|
||||
>
|
||||
<t t-if="item.type === 'dateFilter'">
|
||||
<DropdownItemCustomPeriod field="item" type="'filter'" />
|
||||
</t>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-inherit="web.SearchBarMenu" t-inherit-mode="extension">
|
||||
<xpath
|
||||
expr="//t[@t-foreach='filterItems']//AccordionItem//t[@t-foreach='item.options']"
|
||||
position="after"
|
||||
>
|
||||
<DropdownItemCustomPeriod
|
||||
t-if="item.type == 'dateFilter'"
|
||||
field="item"
|
||||
type="'filter'"
|
||||
/>
|
||||
</xpath>
|
||||
<xpath expr="//t[@t-foreach='comparisonItems']" position="after">
|
||||
<DropdownItemCustomPeriod
|
||||
comparisonItems="comparisonItems"
|
||||
type="'comparison'"
|
||||
/>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
Reference in New Issue
Block a user