From 02175423e5ea8d3bcff42becba7f896def1b274c Mon Sep 17 00:00:00 2001 From: JordiMForgeFlow Date: Tue, 15 Oct 2024 11:39:21 +0200 Subject: [PATCH 1/2] [FIX] web_m2x_options: add fieldColor to KanbanMany2ManyTagsAvatarField --- web_m2x_options/static/src/components/form.esm.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web_m2x_options/static/src/components/form.esm.js b/web_m2x_options/static/src/components/form.esm.js index 9df44283570..5a0b41e22ae 100644 --- a/web_m2x_options/static/src/components/form.esm.js +++ b/web_m2x_options/static/src/components/form.esm.js @@ -10,7 +10,10 @@ import { KanbanMany2OneAvatarField, Many2OneAvatarField, } from "@web/views/fields/many2one_avatar/many2one_avatar_field"; -import {Many2ManyTagsAvatarField} from "@web/views/fields/many2many_tags_avatar/many2many_tags_avatar_field"; +import { + KanbanMany2ManyTagsAvatarField, + Many2ManyTagsAvatarField, +} from "@web/views/fields/many2many_tags_avatar/many2many_tags_avatar_field"; import {Many2XAutocomplete} from "@web/views/fields/relational_utils"; import {evaluateBooleanExpr} from "@web/core/py_js/py"; @@ -63,6 +66,12 @@ Many2ManyTagsAvatarField.props = { fieldColorOptions: {type: Object, optional: true}, }; +KanbanMany2ManyTagsAvatarField.props = { + ...KanbanMany2ManyTagsAvatarField.props, + fieldColor: {type: String, optional: true}, + fieldColorOptions: {type: Object, optional: true}, +}; + patch(many2OneField, { m2o_options_props_create(props, attrs, options) { const ir_options = session.web_m2x_options; From bb4b8a27dc64f1f0e8272157e4f170ebadf8bc58 Mon Sep 17 00:00:00 2001 From: JordiMForgeFlow Date: Wed, 16 Oct 2024 11:31:55 +0200 Subject: [PATCH 2/2] [IMP] web_m2x_options: use common object to reuse in props assignment --- .../static/src/components/form.esm.js | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/web_m2x_options/static/src/components/form.esm.js b/web_m2x_options/static/src/components/form.esm.js index 5a0b41e22ae..380349e35b5 100644 --- a/web_m2x_options/static/src/components/form.esm.js +++ b/web_m2x_options/static/src/components/form.esm.js @@ -21,55 +21,52 @@ import {isX2Many} from "@web/views/utils"; import {patch} from "@web/core/utils/patch"; import {session} from "@web/session"; +const fieldColorProps = { + fieldColor: {type: String, optional: true}, + fieldColorOptions: {type: Object, optional: true}, +}; + Many2OneField.props = { ...Many2OneField.props, noSearchMore: {type: Boolean, optional: true}, - fieldColor: {type: String, optional: true}, - fieldColorOptions: {type: Object, optional: true}, + ...fieldColorProps, }; Many2XAutocomplete.props = { ...Many2XAutocomplete.props, - fieldColor: {type: String, optional: true}, - fieldColorOptions: {type: Object, optional: true}, + ...fieldColorProps, }; KanbanMany2OneAvatarField.props = { ...KanbanMany2OneAvatarField.props, - fieldColor: {type: String, optional: true}, - fieldColorOptions: {type: Object, optional: true}, + ...fieldColorProps, }; Many2OneAvatarField.props = { ...Many2OneAvatarField.props, noSearchMore: {type: Boolean, optional: true}, - fieldColor: {type: String, optional: true}, - fieldColorOptions: {type: Object, optional: true}, + ...fieldColorProps, }; Many2ManyTagsField.props = { ...Many2ManyTagsField.props, searchLimit: {type: Number, optional: true}, - fieldColor: {type: String, optional: true}, - fieldColorOptions: {type: Object, optional: true}, + ...fieldColorProps, }; Many2ManyTagsFieldColorEditable.props = { ...Many2ManyTagsFieldColorEditable.props, searchLimit: {type: Number, optional: true}, - fieldColor: {type: String, optional: true}, - fieldColorOptions: {type: Object, optional: true}, + ...fieldColorProps, }; Many2ManyTagsAvatarField.props = { ...Many2ManyTagsAvatarField.props, - fieldColor: {type: String, optional: true}, - fieldColorOptions: {type: Object, optional: true}, + ...fieldColorProps, }; KanbanMany2ManyTagsAvatarField.props = { ...KanbanMany2ManyTagsAvatarField.props, - fieldColor: {type: String, optional: true}, - fieldColorOptions: {type: Object, optional: true}, + ...fieldColorProps, }; patch(many2OneField, {