[FIX] mail: fix the follower subtypes order

Before this commit, the subtypes are not correctly ordered when
none of the subtypes have a parent model. while it should be
order by parent model, then by sequence.

So in this commit, we will first check if both their parent model
are falsy then we can't order them (A = B). Then we will consider
their sequence, and they will be useful to determine the proper order.

task-2904015

closes odoo/odoo#96402

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Radhika Shyara
2022-07-25 16:33:46 +02:00
committed by Barad Mahendra
parent 08138a3322
commit f65ae53fb2
@@ -69,6 +69,9 @@ export class RelationSet {
const valB = followRelations(b, relatedPath);
switch (compareMethod) {
case 'truthy-first': {
if (valA === valB) {
break;
}
if (!valA) {
return 1;
}
@@ -78,6 +81,9 @@ export class RelationSet {
break;
}
case 'falsy-first': {
if (valA === valB) {
break;
}
if (!valA) {
return -1;
}