summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_model.js
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2018-06-15 09:00:39 +0200
committerNicolas Martinelli <nim-odoo@users.noreply.github.com>2018-06-19 13:09:23 +0200
commit37db3903588026dc6ed73de8090dba59a7c473a6 (patch)
tree037dcab542da13c6b4e4ede680f8bf25b977b95a /addons/web/static/src/js/views/basic/basic_model.js
parentc5789be063c4c83df58673b749a18e4eadd97c58 (diff)
[FIX] web: enable button at end of action
When clicking on an action button, the following steps are performed: 1. Buttons are disabled 2. The button call is performed 3. At the end of the call, the buttons are enabled 4. Extra RPC are performed (`read`, `name_get`) 5. When the RPC calls are finished, the form is reloaded In the case of a validation of a SO, it means that the 'Confirm' button is enabled at step 3, but hidden at step 5. On a slow network (or an overloaded server), it means that the user has enough time (step 4) to click again on the 'Confirm' button and trigger the action more than once. The root cause is that we don't retrieve the promise of the `reload` mechanism (defined in `_callButtonAction`) when executing `on_close` (triggered after the button call). We return a promise which is resolved and enable the buttons too early. We make sure to retrieve the promise of the `reload` and return it, so that the promise of `saveAndExecuteAction` (defined in `_onButtonClicked`) is correctly linked to it. This way, `_enableButtons` is called when the reload is performed. Co-authored-by: Aaron Bohy <aab@odoo.com> (well, actually he did most of it) opw-1859027
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
0 files changed, 0 insertions, 0 deletions