summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-04-04 16:22:58 +0200
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commita529a928b4a295d5a834bcd8ab9a02433be6ff6a (patch)
tree19eb29b37f3ca2c25e75ffcfe86cdab82fdccb7f /addons
parent2bca6535849295e76029b0c237b6367e1162d23a (diff)
[REF] web: prevent useless rerender in some cases
When clicking on a form button, the saveRecord method is called, which will then call the toReadonlymode method, which will rerender the form view, even if it was already in readonly mode.
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/src/js/views/form/form_controller.js6
1 files changed, 4 insertions, 2 deletions
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 7de919a0c2c..498fb29453b 100644
--- a/addons/web/static/src/js/views/form/form_controller.js
+++ b/addons/web/static/src/js/views/form/form_controller.js
@@ -368,8 +368,10 @@ var FormController = BasicController.extend({
* @private
*/
_toReadOnlyMode: function () {
- this.$el.removeClass('o_form_editable');
- this.update({mode: "readonly"}, {reload: false});
+ if (this.mode !== 'readonly') {
+ this.$el.removeClass('o_form_editable');
+ this.update({mode: "readonly"}, {reload: false});
+ }
},
/**
* Updates the controller's title according to the new state