-
+
@@ -82,7 +82,7 @@
multi_edit="1"
open_form_view="True"
js_class="todo_list">
-
+
diff --git a/addons/web/static/src/views/fields/state_selection/state_selection_field.js b/addons/web/static/src/views/fields/state_selection/state_selection_field.js
index f3cfc72de75..5f3c1e5e82d 100644
--- a/addons/web/static/src/views/fields/state_selection/state_selection_field.js
+++ b/addons/web/static/src/views/fields/state_selection/state_selection_field.js
@@ -92,13 +92,12 @@ export const stateSelectionField = {
label: _t("Hide label"),
name: "hide_label",
type: "boolean",
- viewTypes: ["list"],
},
],
supportedTypes: ["selection"],
extractProps({ options, viewType }, dynamicInfo) {
return {
- showLabel: viewType === "list" && !options.hide_label,
+ showLabel: 'hide_label' in options ? !options.hide_label : false,
withCommand: viewType === "form",
readonly: dynamicInfo.readonly,
autosave: "autosave" in options ? !!options.autosave : true,
@@ -107,4 +106,3 @@ export const stateSelectionField = {
};
registry.category("fields").add("state_selection", stateSelectionField);
-registry.category("fields").add("list.state_selection", stateSelectionField);
diff --git a/addons/web/static/tests/views/fields/state_selection_field_tests.js b/addons/web/static/tests/views/fields/state_selection_field_tests.js
index 2369254d9f3..2a00b366612 100644
--- a/addons/web/static/tests/views/fields/state_selection_field_tests.js
+++ b/addons/web/static/tests/views/fields/state_selection_field_tests.js
@@ -209,6 +209,21 @@ QUnit.module("Fields", (hooks) => {
assert.isNotVisible(target.querySelector(".dropdown-menu"));
});
+ QUnit.test("StateSelectionField for form view with hide_label option", async function (assert) {
+ await makeView({
+ type: "form",
+ resModel: "partner",
+ serverData,
+ arch: `
+
+ `,
+ resId: 1,
+ });
+ assert.containsOnce(target, ".o_status_label");
+ });
+
QUnit.test("StateSelectionField for list view with hide_label option", async function (assert) {
Object.assign(serverData.models.partner.fields, {
graph_type: {
@@ -230,7 +245,7 @@ QUnit.module("Fields", (hooks) => {
arch: `
-
+
`,
});