From 6c1c5e13464c41a941ca2918d0d5bb33318ae34a Mon Sep 17 00:00:00 2001 From: std-odoo Date: Wed, 19 Oct 2022 07:52:04 +0000 Subject: [PATCH 1/4] [FIX] web: allow hiding the properties option "View In Kanban" Purpose ======= Some models might use the properties field in the kanban view, some other no. For that purpose, we want to add an option in order to hide the "View In Kanban" checkbox in the properties definition. Task-3012780 X-original-commit: c6fcaa53683c470158e4661aec2575bd06ee3c1e Part-of: odoo/odoo#104252 --- .../static/src/views/fields/properties/properties_field.js | 6 +++++- .../src/views/fields/properties/property_definition.js | 1 + .../src/views/fields/properties/property_definition.xml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/views/fields/properties/properties_field.js b/addons/web/static/src/views/fields/properties/properties_field.js index f12b511b2a5..1d8a0c74f55 100644 --- a/addons/web/static/src/views/fields/properties/properties_field.js +++ b/addons/web/static/src/views/fields/properties/properties_field.js @@ -13,6 +13,7 @@ import { usePopover } from "@web/core/popover/popover_hook"; import { sprintf } from "@web/core/utils/strings"; import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; import { reposition } from '@web/core/position_hook'; +import { archParseBoolean } from '@web/views/utils'; import { Component, useRef, useState, useEffect, onWillStart } from "@odoo/owl"; @@ -447,6 +448,7 @@ export class PropertiesField extends Component { isNewlyCreated: isNewlyCreated, propertyIndex: propertyIndex, propertiesSize: propertiesList.length, + hideKanbanOption: this.props.hideKanbanOption, }, { preventClose: this.checkPopoverClose, @@ -471,10 +473,12 @@ PropertiesField.components = { PropertiesField.props = { ...standardFieldProps, columns: { type: Number, optional: true }, + hideKanbanOption: { type: Boolean, optional: true }, }; PropertiesField.extractProps = ({ attrs, field }) => { const columns = parseInt(attrs.columns || "1"); - return { columns }; + const hideKanbanOption = archParseBoolean(attrs.hideKanbanOption); + return { columns, hideKanbanOption }; }; PropertiesField.displayName = _lt("Properties"); 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 c0fb0d37b03..d10acf8a197 100644 --- a/addons/web/static/src/views/fields/properties/property_definition.js +++ b/addons/web/static/src/views/fields/properties/property_definition.js @@ -383,6 +383,7 @@ PropertyDefinition.props = { readonly: { type: Boolean, optional: true }, canChangeDefinition: { type: Boolean, optional: true }, propertyDefinition: { optional: true }, + hideKanbanOption: { type: Boolean, optional: true }, context: { type: Object }, isNewlyCreated: { type: Boolean, optional: true }, // index and number of properties, to hide the move arrows when needed 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 2551d8d5ac9..86b1cbebe02 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 @@ /> - + View In Kanban From afe9497341721d014653f7f45579b12894181ff5 Mon Sep 17 00:00:00 2001 From: std-odoo Date: Wed, 19 Oct 2022 07:52:56 +0000 Subject: [PATCH 2/4] [FIX] project: hide the "View In Kanban" properties option Purpose ======= We don't use the properties field in the tasks kanban view. Because of this, we want to hide the option "View In Kanban" in the properties definition. Task-3012780 X-original-commit: 63fa07d38e51b261780cadb674ab035f8b15f58e Part-of: odoo/odoo#104252 --- addons/project/views/project_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index 8d3100ced0b..4f94e23a729 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -1188,7 +1188,7 @@ + name="task_properties" nolabel="1" columns="2" hideKanbanOption="1"/> From f207a1a0f2390b7f3295a9450bf64ad58d739d15 Mon Sep 17 00:00:00 2001 From: std-odoo Date: Wed, 19 Oct 2022 07:53:15 +0000 Subject: [PATCH 3/4] [FIX] crm: hide the "View In Kanban" properties option Purpose ======= We don't use the properties field in the leads kanban view. Because of this, we want to hide the option "View In Kanban" in the properties definition. Task-3012780 X-original-commit: 8170e2aede666a4ab2b2395cc3c2d54a87e11cc1 Part-of: odoo/odoo#104252 --- addons/crm/views/crm_lead_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index aacb1fbf915..8720efed338 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -259,7 +259,7 @@ + name="lead_properties" nolabel="1" columns="2" hideKanbanOption="1"/> From 7df64e4eb175e0d9ce58c818d6a62106fa1eb12b Mon Sep 17 00:00:00 2001 From: std-odoo Date: Wed, 19 Oct 2022 13:16:20 +0000 Subject: [PATCH 4/4] [FIX] web: fix the alignment of the checkbox in the definition Task-3012780 X-original-commit: 5451eb187007a91744858d5ff95cff4053d365fe Part-of: odoo/odoo#104252 --- .../src/views/fields/properties/property_definition.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/static/src/views/fields/properties/property_definition.scss b/addons/web/static/src/views/fields/properties/property_definition.scss index ea47d5d265f..8baadbbe450 100644 --- a/addons/web/static/src/views/fields/properties/property_definition.scss +++ b/addons/web/static/src/views/fields/properties/property_definition.scss @@ -55,6 +55,14 @@ width: 100%; display: inline-block !important; } + + .o-checkbox { + padding-left: 0 !important; + + input { + margin-left: 0 !important; + } + } } .o_field_property_definition {