fields
forms
kanban Color Picker Field
Odoo 19 fields — kanban Color Picker Field (views)
Live preview
Interactive
Source excerpt
web/static/src/views/fields/kanban_color_picker/kanban_color_picker_field.js
import { _t } from "@web/core/l10n/translation";
import { ColorList } from "@web/core/colorlist/colorlist";
import { registry } from "@web/core/registry";
import { standardFieldProps } from "../standard_field_props";
import { Component } from "@odoo/owl";
class KanbanColorPickerField extends Component {
static template = "web.KanbanColorPickerField";
static props = standardFieldProps;
get colors() {
return ColorList.COLORS;
}
selectColor(colorIndex) {
return this.props.record.update({ [this.props.name]: colorIndex }, { save: true });
}
}
export const kanbanColorPickerField = {
component: KanbanColorPickerField,
displayName: _t("Color Picker"),
extractProps(fieldInfo, dynamicInfo) {
return {
readonly: dynamicInfo.readonly,
};
},
};
registry.category("fields").add("kanban_color_picker", kanbanColorPickerField);
Registry / API
- Registry name
kanbanColorPickerField- Category
fields- Module
web- Slug
kanban-color-picker-field- Nav group
forms