From 75868ae30e8af8c4be7a5e0c694e3fbcda67ecfa Mon Sep 17 00:00:00 2001 From: Adrien Schoffeniels Date: Wed, 27 Sep 2023 15:05:32 +0200 Subject: [PATCH] [IMP] web: rename "view_in_kanban" key in properties definition Purpose: -------- The "KanbanPropertiesField" has been renamed to "CardPropertiesField". For consistency, the key "view_in_kanban" of the properties definition is renamed to "view_in_cards" Task-3458627 Part-of: odoo/odoo#132578 --- .../properties/card_properties_field.xml | 2 +- .../fields/properties/property_definition.js | 2 +- .../fields/properties/property_definition.xml | 2 +- .../views/calendar/calendar_view_tests.js | 6 ++-- .../views/fields/properties_field_tests.js | 32 +++++++++---------- odoo/fields.py | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/addons/web/static/src/views/fields/properties/card_properties_field.xml b/addons/web/static/src/views/fields/properties/card_properties_field.xml index 1cbc61520f0..1bd33265db8 100644 --- a/addons/web/static/src/views/fields/properties/card_properties_field.xml +++ b/addons/web/static/src/views/fields/properties/card_properties_field.xml @@ -6,7 +6,7 @@ t-foreach="propertiesList" t-as="propertyConfiguration" t-key="propertyConfiguration.name" - t-if="propertyConfiguration.value and propertyConfiguration.view_in_kanban"> + t-if="propertyConfiguration.value and propertyConfiguration.view_in_cards">
diff --git a/addons/web/static/src/views/fields/properties/property_definition.js b/addons/web/static/src/views/fields/properties/property_definition.js index b64a488a540..d96b100529e 100644 --- a/addons/web/static/src/views/fields/properties/property_definition.js +++ b/addons/web/static/src/views/fields/properties/property_definition.js @@ -305,7 +305,7 @@ export class PropertyDefinition extends Component { onViewInKanbanChange(newValue) { const propertyDefinition = { ...this.state.propertyDefinition, - view_in_kanban: newValue, + view_in_cards: newValue, }; this.props.onChange(propertyDefinition); this.state.propertyDefinition = propertyDefinition; diff --git a/addons/web/static/src/views/fields/properties/property_definition.xml b/addons/web/static/src/views/fields/properties/property_definition.xml index e6cc9692f4f..dbe433ecd41 100644 --- a/addons/web/static/src/views/fields/properties/property_definition.xml +++ b/addons/web/static/src/views/fields/properties/property_definition.xml @@ -164,7 +164,7 @@ diff --git a/addons/web/static/tests/views/calendar/calendar_view_tests.js b/addons/web/static/tests/views/calendar/calendar_view_tests.js index 14249b1d276..5db5dd1fce8 100644 --- a/addons/web/static/tests/views/calendar/calendar_view_tests.js +++ b/addons/web/static/tests/views/calendar/calendar_view_tests.js @@ -4811,7 +4811,7 @@ QUnit.module("Views", ({ beforeEach }) => { string: "My Char", type: "char", value: "hello", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_2", @@ -4824,14 +4824,14 @@ QUnit.module("Views", ({ beforeEach }) => { ], value: "b", default: "c", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_3", string: "Hidden Char", type: "char", value: "hidden", - view_in_kanban: false, + view_in_cards: false, }, ]; diff --git a/addons/web/static/tests/views/fields/properties_field_tests.js b/addons/web/static/tests/views/fields/properties_field_tests.js index 2113adde9c0..8e6f85ba7bd 100644 --- a/addons/web/static/tests/views/fields/properties_field_tests.js +++ b/addons/web/static/tests/views/fields/properties_field_tests.js @@ -174,7 +174,7 @@ QUnit.module("Fields", (hooks) => { string: "My Char", type: "char", value: "char value", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_2", @@ -187,7 +187,7 @@ QUnit.module("Fields", (hooks) => { ], value: "b", default: "c", - view_in_kanban: true, + view_in_cards: true, }, ], company_id: 37, @@ -201,7 +201,7 @@ QUnit.module("Fields", (hooks) => { string: "My Char", type: "char", value: "char value", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_2", @@ -214,7 +214,7 @@ QUnit.module("Fields", (hooks) => { ], value: "c", default: "c", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_3", @@ -227,7 +227,7 @@ QUnit.module("Fields", (hooks) => { string: "My Char 4", type: "char", value: "char value 4", - view_in_kanban: true, + view_in_cards: true, }, ], company_id: 37, @@ -264,7 +264,7 @@ QUnit.module("Fields", (hooks) => { name: "property_1", string: "My Char", type: "char", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_2", @@ -276,7 +276,7 @@ QUnit.module("Fields", (hooks) => { ["c", "C"], ], default: "c", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_3", @@ -287,7 +287,7 @@ QUnit.module("Fields", (hooks) => { name: "property_4", string: "My Char 4", type: "char", - view_in_kanban: true, + view_in_cards: true, }, ], }, @@ -1516,14 +1516,14 @@ QUnit.module("Fields", (hooks) => { string: "My Date", type: "date", value: "2019-01-01", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_2", string: "My DateTime", type: "datetime", value: "2019-01-01 10:00:00", - view_in_kanban: true, + view_in_cards: true, }, ], company_id: 37, @@ -1566,7 +1566,7 @@ QUnit.module("Fields", (hooks) => { name: "property_integer", string: "My Integer", type: "integer", - view_in_kanban: true, + view_in_cards: true, }; serverData.models.company.records.push({ id: 38, @@ -1633,35 +1633,35 @@ QUnit.module("Fields", (hooks) => { string: "My Integer", type: "integer", value: 12, - view_in_kanban: true, + view_in_cards: true, }, { name: "property_float", string: "My Float", type: "float", value: 12.2, - view_in_kanban: true, + view_in_cards: true, }, { name: "property_date", string: "My Date", type: "date", value: "2023-06-05", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_datetime", string: "My Datetime", type: "datetime", value: "2023-06-05 11:05:00", - view_in_kanban: true, + view_in_cards: true, }, { name: "property_checkbox", string: "My Checkbox", type: "boolean", value: true, - view_in_kanban: true, + view_in_cards: true, }, ], company_id: 37, diff --git a/odoo/fields.py b/odoo/fields.py index 9a3e7dfb46a..140a1f7da07 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -3803,7 +3803,7 @@ class PropertiesDefinition(Field): REQUIRED_KEYS = ('name', 'type') ALLOWED_KEYS = ( 'name', 'string', 'type', 'comodel', 'default', - 'selection', 'tags', 'domain', 'view_in_kanban', + 'selection', 'tags', 'domain', 'view_in_cards', ) # those keys will be removed if the types does not match PROPERTY_PARAMETERS_MAP = {