diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-05-19 12:08:12 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-05-19 15:51:57 +0200 |
| commit | 702835682e50f38b503ee9312c62e1e79b747cec (patch) | |
| tree | 2e55e8e29d06c0076452ea503ffd4672f84633f6 /addons/web/static/tests/fields/relational_fields_tests.js | |
| parent | c929a81e8f015f9234f68749a29fe6a9c21577b6 (diff) | |
[FIX] web: fetch specialData of fields in x2many form
Suppose that there is a one2many list in a form view containing
a field F, displayed with no widget, and that F is also displayed
in the one2many form view (opened when clicking on a record of the
list), but that in this form view, F is displayed with a widget
requiring specialData (additional data to fetch alongside the
record), e.g. widget="domain".
Before this rev., it crashed when this happened because those
specialData weren't loaded when opening the related record.
Credit goes to @pga-odoo for reporting the bug and reproducing it
in a test.
Diffstat (limited to 'addons/web/static/tests/fields/relational_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 5 |
1 files changed, 4 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 40a1924ba71..8aa872dfb05 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -2482,7 +2482,7 @@ QUnit.module('relational_fields', { form.destroy(); }); - QUnit.test('one2many kanban with edit type action and domain widget (widget wich use SpecialData)', function (assert) { + QUnit.test('one2many kanban with edit type action and domain widget (widget using SpecialData)', function (assert) { assert.expect(1); this.data.turtle.fields.model_name = {string: "Domain Condition Model", type: "char"}; @@ -2504,6 +2504,8 @@ QUnit.module('relational_fields', { '<t t-name="kanban-box">' + '<div><field name="display_name"/></div>' + '<div><field name="turtle_foo"/></div>' + + // field without Widget in the list + '<div><field name="condition"/></div>' + '<div> <a type="edit"> Edit </a> </div>' + '</t>' + '</templates>' + @@ -2511,6 +2513,7 @@ QUnit.module('relational_fields', { '<form>' + '<field name="product_id" widget="statusbar"/>' + '<field name="model_name"/>' + + // field with Widget requiring specialData in the form '<field name="condition" widget="domain" options="{\'model\': \'model_name\'}"/>' + '</form>' + '</field>' + |
