diff options
| author | Mohammed Shekha <msh@odoo.com> | 2020-09-15 12:00:12 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-10-06 07:50:22 +0000 |
| commit | c73a54bfc7ef1924533c6741c50b30efc9ee8d21 (patch) | |
| tree | 11f9e1d9080d1668b5e0ce4877c28ab344a99bda /addons/web/static/tests/fields/basic_fields_tests.js | |
| parent | 4565a65e99a6dae323fd3d7ddf2010fea102bb91 (diff) | |
[FIX] web: do not allow to edit priority field if readonly
if readonly attribute is given on priority widget then priority widget should
not be clickable and hover effect should be removed so that user can easily
understand that field is readonly.
task-2339680
closes odoo/odoo#59189
X-original-commit: 53dbfc7a65a8eb2f41d6b2373cf628c4800d1f57
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 65df3a5af19..8586b9cb82e 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -5830,6 +5830,25 @@ QUnit.module('basic_fields', { list.destroy(); }); + QUnit.test('priority widget with readonly attribute', async function (assert) { + assert.expect(1); + + const form = await createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: ` + <form> + <field name="selection" widget="priority" readonly="1"/> + </form>`, + res_id: 2, + }); + + assert.containsN(form, '.o_field_widget.o_priority span', 2, + "stars of priority widget should rendered with span tag if readonly"); + + form.destroy(); + }); QUnit.module('StateSelection Widget'); |
