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_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_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index c5a1e5765e4..bbbf74f5b7b 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -1370,8 +1370,8 @@ QUnit.module('relational_fields', { // add an other existing tag var $input = form.$('.o_field_many2manytags input'); await testUtils.fields.many2one.clickOpenDropdown('timmy'); - assert.strictEqual($input.autocomplete('widget').find('li').length, 1, - "autocomplete dropdown should have 1 entry"); + assert.strictEqual($input.autocomplete('widget').find('li').length, 2, + "autocomplete dropdown should have 2 entry"); assert.strictEqual($input.autocomplete('widget').find('li a:contains("red")').length, 1, "autocomplete dropdown should contain 'red'"); await testUtils.fields.many2one.clickHighlightedItem('timmy'); @@ -1479,8 +1479,8 @@ QUnit.module('relational_fields', { // add an other existing tag var $input = form.$('.o_field_many2manytags input'); await testUtils.fields.many2one.clickOpenDropdown('timmy'); - assert.strictEqual($input.autocomplete('widget').find('li').length, 1, - "autocomplete dropdown should have 1 entry"); + assert.strictEqual($input.autocomplete('widget').find('li').length, 2, + "autocomplete dropdown should have 2 entry"); assert.strictEqual($input.autocomplete('widget').find('li a:contains("silver")').length, 1, "autocomplete dropdown should contain 'silver'"); await testUtils.fields.many2one.clickHighlightedItem('timmy'); @@ -3452,6 +3452,7 @@ QUnit.module('relational_fields', { relationalFields.FieldMany2One.prototype.AUTOCOMPLETE_DELAY = 0; await testUtils.dom.click(form.$el.find('.o_input_dropdown>input')); + await testUtils.fields.editInput(form.$('.o_field_many2one input'), 'ABC'); // click create and edit await testUtils.dom.click($('.ui-autocomplete .ui-menu-item a:contains(Create and)').trigger('mouseenter')); |
