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/views/basic_model_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/views/basic_model_tests.js')
| -rw-r--r-- | addons/web/static/test/views/basic_model_tests.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/addons/web/static/test/views/basic_model_tests.js b/addons/web/static/test/views/basic_model_tests.js index 7c5e02501e8..7039611917c 100644 --- a/addons/web/static/test/views/basic_model_tests.js +++ b/addons/web/static/test/views/basic_model_tests.js @@ -310,6 +310,10 @@ QUnit.module('Views', { this.params.res_id = 1; this.params.fieldNames = ['category']; + this.params.fieldsInfo = {category: { + relatedFields: {display_name: {type: "char"}}, + fieldsInfo: {display_name: {}}, + }}; var model = createModel({ Model: BasicModel, @@ -319,9 +323,9 @@ QUnit.module('Views', { model.load(this.params).then(function (resultID) { var record = model.get(resultID); assert.strictEqual(record.data.category.data[0].res_id, 12, - "should have loaded many2omany res_ids"); + "should have loaded many2many res_ids"); assert.strictEqual(record.data.category.data[0].data.display_name, "gold", - "should have loaded many2omany display_name"); + "should have loaded many2many display_name"); record = model.get(resultID, {raw: true}); assert.deepEqual(record.data.category, [12], "with option raw, category should only return ids"); @@ -333,6 +337,10 @@ QUnit.module('Views', { assert.expect(2); this.params.fieldNames = ['category']; + this.params.fieldsInfo = {category: { + relatedFields: {date: {type: "date"}}, + fieldsInfo: {date: {}}, + }}; var model = createModel({ Model: BasicModel, @@ -909,7 +917,7 @@ QUnit.module('Views', { data: this.data, }); - this.params.fieldAttrs = { + this.params.fieldsInfo = { product_id: { context: "{'hello2': 'world', 'test2': foo}", domain: "[['hello2', 'like', 'world'], ['test2', 'like', foo]]", |
