diff --git a/addons/web/static/src/model/relational_model/static_list.js b/addons/web/static/src/model/relational_model/static_list.js index 1edf9042c60..46b7a9ec2da 100644 --- a/addons/web/static/src/model/relational_model/static_list.js +++ b/addons/web/static/src/model/relational_model/static_list.js @@ -775,7 +775,10 @@ export class StaticList extends DataPoint { const currentIds = nextCurrentIds.slice(offset, offset + limit); const resIds = this._getResIdsToLoad(currentIds); if (resIds.length) { - const records = await this.model._loadRecords({ ...this.config, resIds }); + const records = await this.model._loadRecords( + { ...this.config, resIds }, + this.evalContext + ); for (const record of records) { this._createRecordDatapoint(record); } diff --git a/addons/web/static/tests/views/fields/one2many_field_tests.js b/addons/web/static/tests/views/fields/one2many_field_tests.js index d7ee4d7e313..66738b0fbb2 100644 --- a/addons/web/static/tests/views/fields/one2many_field_tests.js +++ b/addons/web/static/tests/views/fields/one2many_field_tests.js @@ -5086,6 +5086,42 @@ QUnit.module("Fields", (hooks) => { } ); + QUnit.test( + "one2many list, multi page, with many2one and with context with parent key", + async function (assert) { + serverData.models.partner.records[0].turtles = [1, 2, 3]; + + await makeView({ + type: "form", + resModel: "partner", + serverData, + arch: ` +
`, + resId: 1, + mockRPC(route, { method, model, kwargs }) { + if (method === "web_read" && model === "turtle") { + assert.step("web_read turtle"); + assert.deepEqual( + kwargs.specification.product_id.context, + { partner_foo: "yop" }, + "should have correctly evaluated parent foo field" + ); + } + }, + }); + + await click(target, ".o_x2m_control_panel .o_pager_next"); + assert.verifySteps(["web_read turtle"]); + } + ); + QUnit.test("one2many list, editable, with a date in the context", async function (assert) { assert.expect(1);