summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2017-12-07 09:10:39 +0100
committerLucas Perais (lpe) <lpe@odoo.com>2017-12-11 08:32:04 +0100
commit6c024d1ef0c9e828b09eea17f55748784232a0c9 (patch)
tree1b1344533f1ea273f4bf3b84103a48f147fa6cd3 /addons/web/static/tests/fields
parent88841c392782223ff49814ddc893a632dbf400e8 (diff)
[FIX] web: give context to fetch x2m batched
Before this commit M2Mtags widget did not translate. This was because no context was given to the rpc that fetched the fields Hence, the lang was not passed. After this commit, M2Mtags translate well OPW 784396
Diffstat (limited to 'addons/web/static/tests/fields')
-rw-r--r--addons/web/static/tests/fields/relational_fields_tests.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js
index 01447f46784..42148e6fe88 100644
--- a/addons/web/static/tests/fields/relational_fields_tests.js
+++ b/addons/web/static/tests/fields/relational_fields_tests.js
@@ -8055,7 +8055,7 @@ QUnit.module('relational_fields', {
});
QUnit.test('fieldmany2many tags in editable list', function (assert) {
- assert.expect(4);
+ assert.expect(7);
this.data.partner.records[0].timmy = [12];
@@ -8063,10 +8063,18 @@ QUnit.module('relational_fields', {
View: ListView,
model: 'partner',
data: this.data,
+ context: {take: 'five'},
arch:'<tree editable="bottom">' +
'<field name="foo"/>' +
'<field name="timmy" widget="many2many_tags"/>' +
'</tree>',
+ mockRPC: function (route, args) {
+ if (args.method === 'read' && args.model === 'partner_type') {
+ assert.deepEqual(args.kwargs.context, {take: 'five'},
+ 'The context should be passed to the RPC');
+ }
+ return this._super.apply(this, arguments);
+ }
});
assert.strictEqual(list.$('.o_data_row:first .o_field_many2manytags .badge').length, 1,