Merge PR #2134 into 12.0

Signed-off-by tarteo
This commit is contained in:
OCA-git-bot
2022-02-23 13:09:09 +00:00
2 changed files with 12 additions and 2 deletions

View File

@@ -158,6 +158,10 @@ odoo.define('web_edit_user_filter', function (require) {
*/
_removeValue: function (model, value) {
var toRemove = model.values.filter(function (v) {
if (v.attributes.value == null) {
// Use label if value is not set (eg: pivot time range)
return v.attributes.label === value;
}
if (typeof v.attributes.value === 'object') {
return v.attributes.value.attrs.domain === value;
}

View File

@@ -7,8 +7,14 @@
<div class="list-group">
<t t-foreach="values" t-as="value">
<a class="list-group-item list-group-item-action"
t-attf-data-value="#{typeof value.value === 'object' ? value.value.attrs.domain : value.value}">
<t t-if="value.value">
<t t-set="data" t-value="typeof value.value === 'object' ? value.value.attrs.domain : value.value"/>
</t>
<t t-else="">
<!-- Use label if no value exists for this filter (eg: pivot time range) -->
<t t-set="data" t-value="value.label"/>
</t>
<a class="list-group-item list-group-item-action" t-attf-data-value="#{data}">
<span>
<t t-esc="value.label"/>
</span>