[REF] web: sample server: _mockReadGroup
The function used to group fake records in _mockReadGroup was overcomplicated. We simplify it. closes odoo/odoo#108921 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -436,14 +436,7 @@ export class SampleServer {
|
||||
const groups = arrayGroupBy(records, (record) => {
|
||||
const vals = {};
|
||||
for (const gb of normalizedGroupBys) {
|
||||
const { fieldName, type } = gb;
|
||||
let value;
|
||||
if (["date", "datetime"].includes(type)) {
|
||||
value = this._formatValue(record[fieldName], gb);
|
||||
} else {
|
||||
value = record[fieldName];
|
||||
}
|
||||
vals[fieldName] = value;
|
||||
vals[gb.fieldName] = record[gb.fieldName];
|
||||
}
|
||||
return JSON.stringify(vals);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user