diff --git a/addons/mail/static/src/model/model_field_relation_set.js b/addons/mail/static/src/model/model_field_relation_set.js index a69ebd5c828..8f067af3c76 100644 --- a/addons/mail/static/src/model/model_field_relation_set.js +++ b/addons/mail/static/src/model/model_field_relation_set.js @@ -77,6 +77,15 @@ export class RelationSet { } break; } + case 'falsy-first': { + if (!valA) { + return -1; + } + if (!valB) { + return 1; + } + break; + } case 'case-insensitive-asc': { if (typeof valA !== 'string' || typeof valB !== 'string') { break; diff --git a/addons/mail/static/src/models/follower_subtype.js b/addons/mail/static/src/models/follower_subtype.js index 7a240514c09..4484012bfd3 100644 --- a/addons/mail/static/src/models/follower_subtype.js +++ b/addons/mail/static/src/models/follower_subtype.js @@ -57,6 +57,8 @@ registerModel({ parentModel: attr(), // AKU FIXME: use relation instead resModel: attr(), - sequence: attr(), + sequence: attr({ + default: 1, + }), }, }); diff --git a/addons/mail/static/src/models/follower_subtype_list.js b/addons/mail/static/src/models/follower_subtype_list.js index 808f047e0ae..f770e81c0e2 100644 --- a/addons/mail/static/src/models/follower_subtype_list.js +++ b/addons/mail/static/src/models/follower_subtype_list.js @@ -49,6 +49,12 @@ registerModel({ */ _sortFollowerSubtypeViews() { return [ + ['falsy-first', 'subtype.parentModel'], + ['case-insensitive-asc', 'subtype.parentModel'], + ['falsy-first', 'subtype.resModel'], + ['case-insensitive-asc', 'subtype.resModel'], + ['smaller-first', 'subtype.isInternal'], + ['smaller-first', 'subtype.sequence'], ['smaller-first', 'subtype.id'], ]; },