[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) <fge@odoo.com>
This commit is contained in:
Aaron Bohy
2023-12-19 12:20:07 +00:00
parent a058996ecc
commit f8702f24db
@@ -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" },