diff --git a/addons/web/static/src/js/views/form/form_controller.js b/addons/web/static/src/js/views/form/form_controller.js index 921c6227c93..407567f728a 100644 --- a/addons/web/static/src/js/views/form/form_controller.js +++ b/addons/web/static/src/js/views/form/form_controller.js @@ -478,7 +478,10 @@ var FormController = BasicController.extend({ * @override */ _shouldBounceOnClick(element) { - return this.mode === 'readonly' && !!element.closest('.oe_title, .o_inner_group'); + return this.mode === 'readonly' && + !!element.closest('.oe_title, .o_inner_group') && + !element.classList.contains("o_form_label") && + !element.classList.contains("o_quick_editable"); }, //-------------------------------------------------------------------------- diff --git a/addons/web/static/tests/views/form_tests.js b/addons/web/static/tests/views/form_tests.js index 383f036f5ba..baccfe1dcb2 100644 --- a/addons/web/static/tests/views/form_tests.js +++ b/addons/web/static/tests/views/form_tests.js @@ -11150,6 +11150,38 @@ QUnit.module('Views', { form.destroy(); }); + QUnit.test('Quick Edition: do not bounce edit button when click on field or label', async function (assert) { + assert.expect(2); + + const MULTI_CLICK_TIME = 50; + + const form = await createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: ` +
+ + + +
`, + formMultiClickTime: MULTI_CLICK_TIME, + res_id: 1, + }); + + await testUtils.dom.click(form.$('.o_field_widget')); + assert.containsNone(form, 'button.o_catch_attention:visible'); + await concurrency.delay(MULTI_CLICK_TIME); + + await testUtils.form.clickDiscard(form); + + await testUtils.dom.click(form.$('.o_form_label')); + assert.containsNone(form, 'button.o_catch_attention:visible'); + await concurrency.delay(MULTI_CLICK_TIME); + + form.destroy(); + }); + QUnit.test("attach callbacks with long processing in __renderView", async function (assert) { /** * The main use case of this test is discuss, in which the FormRenderer