From f8702f24dbea4aea47447a3f53fdfe8d33bf2699 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 15 Dec 2023 09:29:03 +0100 Subject: [PATCH] [FIX] mail: kanban_activity: define options of the selection field When defining a selection field as field dependency, one must specify the options of that selection field (or at least an empty list if options don't matter). Because if that field isn't in the arch (which is the point of defining field dependencies), and the model has to process a value for that field, it will crash in `parseServerValue` (selection case). There's no scenario to reproduce this in standard, but one can build one: edit the project task form view arch, in the child_ids x2many, set mode="tree,kanban", but do not add the kanban nor the form view inline (s.t. default views are used). Then open the view in mobile and click to add a record in the relation. closes odoo/odoo#146435 Signed-off-by: Francois Georis (fge) --- .../src/views/web/fields/kanban_activity/kanban_activity.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/views/web/fields/kanban_activity/kanban_activity.js b/addons/mail/static/src/views/web/fields/kanban_activity/kanban_activity.js index 243b0fd9fe8..3a21dcacac4 100644 --- a/addons/mail/static/src/views/web/fields/kanban_activity/kanban_activity.js +++ b/addons/mail/static/src/views/web/fields/kanban_activity/kanban_activity.js @@ -11,7 +11,11 @@ export class KanbanActivity extends Component { static components = { ActivityButton }; // used in children, in particular in ActivityButton static fieldDependencies = [ - { name: "activity_exception_decoration", type: "selection" }, + { + name: "activity_exception_decoration", + type: "selection", + selection: [("warning", "Alert"), ("danger", "Error")], + }, { name: "activity_exception_icon", type: "char" }, { name: "activity_state", type: "selection" }, { name: "activity_summary", type: "char" },