From c73a54bfc7ef1924533c6741c50b30efc9ee8d21 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Tue, 15 Sep 2020 12:00:12 +0000 Subject: [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) --- addons/web/static/tests/fields/basic_fields_tests.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'addons/web/static/tests/fields/basic_fields_tests.js') 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: ` +
+ + `, + 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'); -- cgit v1.2.3