diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-11-09 19:16:05 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-11-09 19:16:05 +0100 |
| commit | de93645fe3c85883d2f08677afad51456815fa6e (patch) | |
| tree | 618ad9d3144a272e082aee1fc4b824f97a13a59f /addons/web/static/tests/views/view_dialogs_tests.js | |
| parent | acd26691eef2930b03c2d3fb228110a1a6cc5f12 (diff) | |
| parent | 82add438f21085a799f1d2d86a44d523c4fd2690 (diff) | |
[MERGE] forward port branch saas-16 up to 82add438f21
Diffstat (limited to 'addons/web/static/tests/views/view_dialogs_tests.js')
| -rw-r--r-- | addons/web/static/tests/views/view_dialogs_tests.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/view_dialogs_tests.js b/addons/web/static/tests/views/view_dialogs_tests.js index 43bf4ee6694..7a107c70346 100644 --- a/addons/web/static/tests/views/view_dialogs_tests.js +++ b/addons/web/static/tests/views/view_dialogs_tests.js @@ -140,6 +140,44 @@ QUnit.module('Views', { dialog.destroy(); }); + QUnit.test('SelectCreateDialog correctly evaluates domains', function (assert) { + assert.expect(1); + + var parent = createParent({ + data: this.data, + archs: { + 'partner,false,list': + '<tree string="Partner">' + + '<field name="display_name"/>' + + '<field name="foo"/>' + + '</tree>', + 'partner,false,search': + '<search>' + + '<field name="foo"/>' + + '</search>', + }, + mockRPC: function (route, args) { + if (route === '/web/dataset/search_read') { + assert.deepEqual(args.domain, [['id', '=', 2]], + "should have correctly evaluated the domain"); + } + return this._super.apply(this, arguments); + }, + session: { + user_context: {uid: 2}, + }, + }); + + var dialog = new dialogs.SelectCreateDialog(parent, { + no_create: true, + readonly: true, + res_model: 'partner', + domain: "[['id', '=', uid]]", + }).open(); + + dialog.destroy(); + }); + QUnit.test('SelectCreateDialog list view in readonly', function (assert) { assert.expect(1); |
