diff --git a/addons/board/static/tests/add_to_dashboard_tests.js b/addons/board/static/tests/add_to_dashboard_tests.js
index c4dc1f907df..ddea0e7e56c 100644
--- a/addons/board/static/tests/add_to_dashboard_tests.js
+++ b/addons/board/static/tests/add_to_dashboard_tests.js
@@ -9,10 +9,8 @@ import {
triggerEvent,
} from "@web/../tests/helpers/utils";
import {
- applyFilter,
applyGroup,
- editConditionValue,
- toggleAddCustomFilter,
+ removeFacet,
toggleAddCustomGroup,
toggleComparisonMenu,
toggleFavoriteMenu,
@@ -82,11 +80,7 @@ QUnit.module("Board", (hooks) => {
};
LegacyFavoriteMenu.registry.add("add-to-board-menu", LegacyAddToBoard, 10);
- favoriteMenuRegistry.add(
- "add-to-board",
- addToBoardItem,
- { sequence: 10 }
- );
+ favoriteMenuRegistry.add("add-to-board", addToBoardItem, { sequence: 10 });
serverData = { models };
target = getFixture();
});
@@ -167,7 +161,12 @@ QUnit.module("Board", (hooks) => {
patchWithCleanup(browser, { setTimeout: (fn) => fn() });
serverData.views = {
"partner,false,list": '
',
- "partner,false,search": "",
+ "partner,false,search": `
+
+
+
+
+ `,
};
const mockRPC = (route, args) => {
@@ -204,9 +203,7 @@ QUnit.module("Board", (hooks) => {
var filter_count = 0;
// Add a first filter
await toggleFilterMenu(target);
- await toggleAddCustomFilter(target);
- await editConditionValue(target, 0, "a");
- await applyFilter(target);
+ await toggleMenuItem(target, "Filter on a");
// Add it to dashboard
await toggleFavoriteMenu(target);
@@ -214,13 +211,12 @@ QUnit.module("Board", (hooks) => {
await testUtils.dom.click($(".o_add_to_board .dropdown-menu button"));
// Remove it
- await testUtils.dom.click(target.querySelector(".o_facet_remove"));
+ await removeFacet(target);
// Add the second filter
await toggleFilterMenu(target);
- await toggleAddCustomFilter(target);
- await editConditionValue(target, 0, "b");
- await applyFilter(target);
+ await toggleMenuItem(target, "Filter on b");
+
// Add it to dashboard
await toggleFavoriteMenu(target);
await testUtils.dom.triggerEvent(
@@ -230,7 +226,7 @@ QUnit.module("Board", (hooks) => {
await testUtils.dom.click(target.querySelector(".o_add_to_board .dropdown-menu button"));
});
- QUnit.test("save a action domain to dashboard", async function (assert) {
+ QUnit.test("save an action domain to dashboard", async function (assert) {
// View domains are to be added to the dashboard domain
assert.expect(1);
@@ -242,7 +238,11 @@ QUnit.module("Board", (hooks) => {
serverData.views = {
"partner,false,list": '
',
- "partner,false,search": "",
+ "partner,false,search": `
+
+
+
+ `,
};
const mockRPC = (route, args) => {
@@ -264,9 +264,8 @@ QUnit.module("Board", (hooks) => {
// Add a filter
await toggleFilterMenu(target);
- await toggleAddCustomFilter(target);
- await editConditionValue(target, 0, "b");
- await applyFilter(target);
+ await toggleMenuItem(target, "Filter");
+
// Add it to dashboard
await toggleFavoriteMenu(target);
await testUtils.dom.triggerEvent(
@@ -282,7 +281,7 @@ QUnit.module("Board", (hooks) => {
serverData.views = {
"partner,false,pivot": '',
- "partner,false,search": '',
+ "partner,false,search": "",
};
registry.category("services").add("user", makeFakeUserService());
const webClient = await createWebClient({ serverData });
diff --git a/addons/web/static/src/core/domain_selector_dialog/domain_selector_dialog.js b/addons/web/static/src/core/domain_selector_dialog/domain_selector_dialog.js
index 2be8cab429b..48350533110 100644
--- a/addons/web/static/src/core/domain_selector_dialog/domain_selector_dialog.js
+++ b/addons/web/static/src/core/domain_selector_dialog/domain_selector_dialog.js
@@ -1,15 +1,14 @@
/** @odoo-module **/
+import { _t } from "../l10n/translation";
+import { Component, useState } from "@odoo/owl";
import { Dialog } from "../dialog/dialog";
import { DomainSelector } from "../domain_selector/domain_selector";
-import { _t } from "../l10n/translation";
-
-import { Component, useState } from "@odoo/owl";
export class DomainSelectorDialog extends Component {
setup() {
this.state = useState({
- value: this.props.initialValue,
+ domain: this.props.domain,
});
}
@@ -24,15 +23,15 @@ export class DomainSelectorDialog extends Component {
readonly: this.props.readonly,
isDebugMode: this.props.isDebugMode,
defaultLeafValue: this.props.defaultLeafValue,
- value: this.state.value,
- update: (value) => {
- this.state.value = value;
+ value: this.state.domain,
+ update: (domain) => {
+ this.state.domain = domain;
},
};
}
- async onSave() {
- await this.props.onSelected(this.state.value);
+ async onConfirm() {
+ await this.props.onConfirm(this.state.domain);
this.props.close();
}
onDiscard() {
@@ -46,18 +45,17 @@ DomainSelectorDialog.components = {
};
DomainSelectorDialog.props = {
close: Function,
- className: { type: String, optional: true },
+ onConfirm: Function,
resModel: String,
- readonly: { type: Boolean, optional: true },
- isDebugMode: { type: Boolean, optional: true },
+ className: { type: String, optional: true },
defaultLeafValue: { type: Array, optional: true },
- initialValue: { type: String, optional: true },
- onSelected: { type: Function, optional: true },
+ domain: { type: String, optional: true },
+ isDebugMode: { type: Boolean, optional: true },
+ readonly: { type: Boolean, optional: true },
text: { type: String, optional: true },
};
DomainSelectorDialog.defaultProps = {
- initialValue: "",
- onSelected: () => {},
- readonly: true,
+ domain: "[]",
isDebugMode: false,
+ readonly: false,
};
diff --git a/addons/web/static/src/core/domain_selector_dialog/domain_selector_dialog.xml b/addons/web/static/src/core/domain_selector_dialog/domain_selector_dialog.xml
index 923066f2c4d..482e64f1f7c 100644
--- a/addons/web/static/src/core/domain_selector_dialog/domain_selector_dialog.xml
+++ b/addons/web/static/src/core/domain_selector_dialog/domain_selector_dialog.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/addons/web/static/src/legacy/js/control_panel/custom_filter_item.js b/addons/web/static/src/legacy/js/control_panel/custom_filter_item.js
index 878264a121d..430d16da76b 100644
--- a/addons/web/static/src/legacy/js/control_panel/custom_filter_item.js
+++ b/addons/web/static/src/legacy/js/control_panel/custom_filter_item.js
@@ -276,6 +276,6 @@
CustomFilterItem.components = { DatePicker, DateTimePicker, Dropdown };
CustomFilterItem.props = { fields: Object };
- CustomFilterItem.template = "web.CustomFilterItem";
+ CustomFilterItem.template = "web.Legacy.CustomFilterItem";
export default CustomFilterItem;
diff --git a/addons/web/static/src/legacy/xml/base.xml b/addons/web/static/src/legacy/xml/base.xml
index 25ce87cc3d2..4b9a50cb009 100644
--- a/addons/web/static/src/legacy/xml/base.xml
+++ b/addons/web/static/src/legacy/xml/base.xml
@@ -369,6 +369,114 @@
+
+
+
+