diff options
| author | Dhruv Patel <dhp@odoo.com> | 2020-06-03 10:35:33 +0000 |
|---|---|---|
| committer | Julien Mougenot <jum@odoo.com> | 2020-06-10 13:08:33 +0000 |
| commit | eacbec1e03b1f25e71875fb7caed646a53af67ed (patch) | |
| tree | 0945bb57b0c438bc8af7ee3b21f1cc49567bf28f /addons/web/static/tests/fields/relational_fields/field_one2many_tests.js | |
| parent | a392da16015c69161814e83f1cde5ddf40782505 (diff) | |
[IMP] web,*: highlight quick create feature to user
Generally, Users are not necessarily aware that they can quick create a most
records by simply typing in their name+enter in the many2xxx field input.
The exact purpose of this commit is to make sure the user discovers the quick
create feature of our many2xxx fields.
For that, when the input is empty, display 'Start typing to create a record...'
at the bottom of the dropdown when can_create is set and no_create_edit option
not set. So the user can easily understand that by typing and pressing enter
will create the new record.
Also "Search and Create" options in the dropdown only been shown to the user
when it type anything in the input box as the same case in the "Create" option.
Task : 2266557
Co-authored-by: Mohammed Shekha <msh@openerp.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Diffstat (limited to 'addons/web/static/tests/fields/relational_fields/field_one2many_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields/field_one2many_tests.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js b/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js index c2801eb9ac1..f3e5b036fb5 100644 --- a/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js +++ b/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js @@ -264,7 +264,7 @@ QUnit.module('fields', {}, function () { }); QUnit.test('O2M with parented m2o and domain on parent.m2o', async function (assert) { - assert.expect(3); + assert.expect(4); /* records in an o2m can have a m2o pointing to themselves * in that case, a domain evaluation on that field followed by name_search @@ -299,8 +299,7 @@ QUnit.module('fields', {}, function () { await testUtils.dom.click(form.$('.o_field_x2many_list[name=turtles] .o_field_x2many_list_row_add a')); - await testUtils.fields.many2one.clickOpenDropdown('parent_id'); - await testUtils.fields.many2one.clickHighlightedItem('parent_id'); + await testUtils.fields.many2one.createAndEdit('parent_id'); var $modal = $('.modal-content'); @@ -8131,8 +8130,7 @@ QUnit.module('fields', {}, function () { assert.containsOnce(form, '.o_selected_row', "should have create a new row in edition"); - await testUtils.fields.many2one.clickOpenDropdown('turtle_trululu'); - await testUtils.fields.many2one.clickItem('turtle_trululu','Create and Edit...'); + await testUtils.fields.many2one.createAndEdit('turtle_trululu', "ABC"); assert.strictEqual($('.modal .o_form_view').length, 1, "should have opened a form view in a dialog"); |
