mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_advanced_search: Migration to 15.0
This commit is contained in:
17
web_advanced_search/static/src/xml/AdvancedFilterItem.xml
Normal file
17
web_advanced_search/static/src/xml/AdvancedFilterItem.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright 2017-2018 Jairo Llopis <jairo.llopis@tecnativa.com>
|
||||
Copyright 2022 Camptocamp SA (https://www.camptocamp.com).
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<templates>
|
||||
<t t-name="web_advanced_search.AdvancedFilterItem" owl="1">
|
||||
<DropdownItem
|
||||
t-ref="dropdown-item"
|
||||
t-on-click="onClick"
|
||||
class="o_add_advanced_search"
|
||||
>
|
||||
Add Advanced Filter
|
||||
</DropdownItem>
|
||||
</t>
|
||||
</templates>
|
||||
22
web_advanced_search/static/src/xml/CustomFilterItem.xml
Normal file
22
web_advanced_search/static/src/xml/CustomFilterItem.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright 2017-2018 Jairo Llopis <jairo.llopis@tecnativa.com>
|
||||
Copyright 2022 Camptocamp SA (https://www.camptocamp.com).
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<templates>
|
||||
<t t-inherit="web.CustomFilterItem" t-inherit-mode="extension" owl="1">
|
||||
<xpath expr="//select[@t-elif]" position="after">
|
||||
<t
|
||||
t-elif="fieldType === 'many2one' and ['=', '!='].includes(selectedOperator.symbol)"
|
||||
>
|
||||
<RecordPicker
|
||||
model="fields[condition.field].relation"
|
||||
string="fields[condition.field].string"
|
||||
context="fields[condition.field].context"
|
||||
t-on-change="onRelationalChanged(condition)"
|
||||
/>
|
||||
</t>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
13
web_advanced_search/static/src/xml/FilterMenu.xml
Normal file
13
web_advanced_search/static/src/xml/FilterMenu.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
Copyright 2017-2018 Jairo Llopis <jairo.llopis@tecnativa.com>
|
||||
Copyright 2022 Camptocamp SA (https://www.camptocamp.com).
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<templates>
|
||||
<t t-inherit="web.legacy.FilterMenu" t-inherit-mode="extension" owl="1">
|
||||
<CustomFilterItem position="after">
|
||||
<AdvancedFilterItem />
|
||||
</CustomFilterItem>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!-- Copyright 2017-2018 Jairo Llopis <jairo.llopis@tecnativa.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<templates>
|
||||
<t t-inherit="web.FilterMenu" t-inherit-mode="extension" owl="1">
|
||||
<xpath expr="//CustomFilterItem" position="after">
|
||||
<li t-if="items.length" class="dropdown-divider" role="separator" />
|
||||
<AdvancedFilterItem fields="props.fields" />
|
||||
</xpath>
|
||||
</t>
|
||||
<t t-inherit="web.CustomFilterItem" t-inherit-mode="extension" owl="1">
|
||||
<xpath expr="//select[@t-elif]" position="after">
|
||||
<t t-elif="fieldType === 'many2one'">
|
||||
<t
|
||||
t-if="selectedOperator.symbol === '=' || selectedOperator.symbol === '!='"
|
||||
>
|
||||
<Relational />
|
||||
</t>
|
||||
<input
|
||||
t-else=""
|
||||
type="text"
|
||||
class="o_input"
|
||||
t-att-value="condition.displayedValue"
|
||||
t-on-input="_onValueInput(condition)"
|
||||
/>
|
||||
</t>
|
||||
</xpath>
|
||||
</t>
|
||||
<t t-name="web_advanced_search.AdvancedFilterItem" owl="1">
|
||||
<div class="o_generator_menu">
|
||||
<button
|
||||
type="button"
|
||||
class="o_add_advanced_search dropdown-item"
|
||||
aria-expanded="false"
|
||||
t-on-click="advanced_search_open"
|
||||
>
|
||||
<t>Add Advanced Filter</t>
|
||||
</button>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
Reference in New Issue
Block a user