Skip to Content
OWL data_display

Custom Group By Item

Odoo 19 OWL component — Custom Group By Item (search)

Live preview Interactive
Source excerpt web/static/src/search/custom_group_by_item/custom_group_by_item.js
import { Component } from "@odoo/owl";

export class CustomGroupByItem extends Component {
    static template = "web.CustomGroupByItem";
    static props = {
        fields: Array,
        onAddCustomGroup: Function,
    };

    get choices() {
        return this.props.fields.map((f) => ({ label: f.string, value: f.name }));
    }

    onSelected(ev) {
        if (ev.target.value) {
            this.props.onAddCustomGroup(ev.target.value);
            // reset the placeholder
            ev.target.value = "";
        }
    }
}
Registry / API
Registry name
CustomGroupByItem
Category
Module
web
Slug
custom-group-by-item
Nav group
data_display