diff --git a/addons/barcodes/static/tests/barcode_tests.js b/addons/barcodes/static/tests/barcode_tests.js index 6397a278628..3c1d5e42562 100644 --- a/addons/barcodes/static/tests/barcode_tests.js +++ b/addons/barcodes/static/tests/barcode_tests.js @@ -124,6 +124,44 @@ QUnit.test('Button with barcode_trigger', async function (assert) { form.destroy(); }); +QUnit.test('Two buttons with same barcode_trigger and the same string and action', async function (assert) { + assert.expect(2); + + var form = await createView({ + View: FormView, + model: 'product', + data: this.data, + arch: '
' + + '
' + + '
' + + '
', + res_id: 2, + + services: { + notification: { + notify: function (params) { + assert.step(params.type); + } + }, + }, + intercepts: { + execute_action: function (event) { + assert.strictEqual(event.data.action_data.name, 'do_something', + "do_something method call verified"); + }, + }, + }); + + // O-BTN.doit should call execute_action as the first button is visible + simulateBarCode(['O','-','B','T','N','.','d','o','i','t','Enter']); + await testUtils.nextTick(); + assert.verifySteps([], "no warning should be displayed"); + + form.destroy(); +}); + QUnit.test('edit, save and cancel buttons', async function (assert) { assert.expect(6);