[FIX] web: o2m multi page sort on two column

Part-of: odoo/odoo#114024
This commit is contained in:
FrancoisGe
2023-07-24 20:17:51 +02:00
committed by Aaron Bohy
parent a189424ff4
commit afa7160d07
2 changed files with 7 additions and 1 deletions
@@ -860,7 +860,7 @@ export class StaticList extends DataPoint {
const fieldNames = orderBy.map((o) => o.name);
const resIds = this._getResIdsToLoad(currentIds, fieldNames);
if (resIds.length) {
const activeFields = pick(this.activeFields, fieldNames);
const activeFields = pick(this.activeFields, ...fieldNames);
const config = { ...this.config, resIds, activeFields };
const records = await this.model._loadRecords(config);
for (const record of records) {
@@ -2971,6 +2971,12 @@ QUnit.module("Fields", (hooks) => {
["abc1", "xyz1"]
);
await click(target.querySelector("table thead [data-name='int_field'].o_column_sortable"));
assert.deepEqual(
[...target.querySelectorAll(".o_data_row")].map((c) => c.textContent),
["abc1", "xyz1"]
);
await click(target.querySelector("table thead [data-name='foo'].o_column_sortable"));
assert.deepEqual(
[...target.querySelectorAll(".o_data_row")].map((c) => c.textContent),