3
0
Fork 0

[IMP] web_filter_header_button: show groupBy filters

Now we can configure group filters to show up along the other filters so
users can easily access those as well.

TT49232
15.0-ocabot-merge-pr-2789-by-pedrobaeza-bump-patch
David 2024-05-24 10:42:25 +02:00
parent 411eef22f2
commit 4abd48d24f
3 changed files with 20 additions and 0 deletions

View File

@ -14,6 +14,11 @@
name="context"
>{'shown_in_panel': {'icon': 'fa-toggle-off', 'hotkey': 'u'}}</attribute>
</filter>
<filter name="state" position="attributes">
<attribute
name="context"
>{'group_by':'state', 'shown_in_panel': {'icon': 'fa-th-list', 'hotkey': 's'}}</attribute>
</filter>
</field>
</record>
</odoo>

View File

@ -32,5 +32,17 @@ patch(
}
return preFilter;
},
/**
* Allow groupBy filters to show up as buttons
* @override
* @param {Object} filter
* @param {Object} attrs
*/
_extractAttributes(filter, attrs) {
this._super(...arguments);
if (filter.type === "groupBy" && attrs.context.shown_in_panel) {
filter.context = attrs.context;
}
},
}
);

View File

@ -30,6 +30,9 @@ export class FilterButton extends Component {
favorite: {
color: "warning",
},
groupBy: {
color: "info",
},
};
return mapping[filter.type];
}