diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2019-01-03 16:53:21 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2019-01-03 17:00:18 +0000 |
| commit | 27a084eb814acd81679db1e461c53389d6afc875 (patch) | |
| tree | 4c1c0230e4399c03d2a355e34c8058f5505c3a72 /addons/web/static/src/js/widgets/attach_document.js | |
| parent | d96c42ea88cc9cf69bb850cc8d21ee18ee7f16dd (diff) | |
[FIX] web: attach document fix click on firefox
As of saas-11.3 there is a "Attach document" widget that is meant to
more easily add attachment.
But on firefox the click event is coming from the button, where on other
browsers it was possibly from a child element.
So the code expecting the child element did not work on firefox.
opw-1920842
closes #29903
Diffstat (limited to 'addons/web/static/src/js/widgets/attach_document.js')
| -rw-r--r-- | addons/web/static/src/js/widgets/attach_document.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/widgets/attach_document.js b/addons/web/static/src/js/widgets/attach_document.js index 041b021d60b..13496f3aea7 100644 --- a/addons/web/static/src/js/widgets/attach_document.js +++ b/addons/web/static/src/js/widgets/attach_document.js @@ -11,7 +11,7 @@ var _t = core._t; var AttachDocument = Widget.extend({ template: 'AttachDocument', events: { - 'click span.o_attach_document': '_onClickAttachDocument', + 'click': '_onClickAttachDocument', 'change input.o_input_file': '_onFileChanged', }, /** @@ -76,6 +76,9 @@ var AttachDocument = Widget.extend({ * @param {Event} ev */ _onClickAttachDocument: function (ev) { + if ($(ev.target).is('input.o_input_file')) { + return; + } var fieldNames = this.getParent().canBeSaved(this.state.id); if (fieldNames.length) { return this._notifyInvalidFields(fieldNames); |
