diff options
| author | Christophe Matthieu <chm@odoo.com> | 2017-03-21 15:30:58 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | eaa66d11568b415b8d6b4c7a17a058b5ec1df4a6 (patch) | |
| tree | 822fe86e984e69f989c3574936fe1792ae96fe9b /addons/web/static/test/fields/relational_fields_tests.js | |
| parent | e1eea38f2f940fbe252273a5a9d4d03474f81d0a (diff) | |
[REF] web: change internal representation of fields and view meta datas
* Data manager load_view returns a viewInfo object
* ViewInfo contains: the arch, fields and fieldsInfo objects, and some extra informations
* The fields come from the server and are frozen, without any view attributes (depend of the model).
* The fieldsInfo contains every view attributes and informations.
Diffstat (limited to 'addons/web/static/test/fields/relational_fields_tests.js')
| -rw-r--r-- | addons/web/static/test/fields/relational_fields_tests.js | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/addons/web/static/test/fields/relational_fields_tests.js b/addons/web/static/test/fields/relational_fields_tests.js index 208a3c1023b..93104bbd516 100644 --- a/addons/web/static/test/fields/relational_fields_tests.js +++ b/addons/web/static/test/fields/relational_fields_tests.js @@ -1395,7 +1395,7 @@ QUnit.module('relational_fields', { rpcCount++; if (args.method === 'write') { assert.deepEqual(args.args[1].p, [[0, false, { - int_field: 123, product_id: 41 + display_name: false, int_field: 123, product_id: 41 }]]); } return this._super(route, args); @@ -2104,6 +2104,71 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.test('one2many (who contains a one2many) with tree view and without form view', function (assert) { + assert.expect(1); + + // avoid error in _postprocess + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: '<form string="Partners">' + + '<group>' + + '<field name="turtles">' + + '<tree>' + + '<field name="partner_ids"/>' + + '</tree>' + + '</field>' + + '</group>' + + '</form>', + res_id: 1, + archs: { + "turtle,false,form": '<form string="Turtles"><field name="turtle_foo"/></form>', + }, + }); + + form.$('.o_data_row:first').click(); + + assert.strictEqual($('.modal .o_form_field[name="turtle_foo"]').text(), 'blip', + 'should open the modal and display the form field'); + + form.destroy(); + }); + + QUnit.test('one2many (who contains display_name) with tree view and without form view', function (assert) { + assert.expect(1); + + // avoid error in _fetchX2Manys + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: '<form string="Partners">' + + '<group>' + + '<field name="turtles">' + + '<tree>' + + '<field name="display_name"/>' + + '</tree>' + + '</field>' + + '</group>' + + '</form>', + res_id: 1, + archs: { + "turtle,false,form": '<form string="Turtles"><field name="turtle_foo"/></form>', + }, + }); + + form.$('.o_data_row:first').click(); + + assert.strictEqual($('.modal .o_form_field[name="turtle_foo"]').text(), 'blip', + 'should open the modal and display the form field'); + + form.destroy(); + }); + + QUnit.module('FieldMany2Many'); QUnit.test('many2many kanban: edition', function (assert) { |
