diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2018-11-26 12:54:39 +0000 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2018-11-27 08:53:17 +0000 |
| commit | 23313583b2b111610abb1940034859b07282f33b (patch) | |
| tree | dec82342ef68f2c0e9aadf52d5f959b146fc085e /addons/web/static/src/js/fields/basic_fields.js | |
| parent | 4be90e98d7683acc436ce8b707626a27234b9396 (diff) | |
[FIX] web: progressbar updates on field reset
Have a form record with a progress bar
Modify the max_value of the progress, as well as the current_value bar through an onchange
Before this commit, the new max_value was not taken into account
After this commit, it is.
closes odoo/odoo#29056
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index b52567d5c7a..fd156f2d00b 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -2014,6 +2014,18 @@ var FieldProgressBar = AbstractField.extend({ this.$('.o_progressbar_value').focus().select(); } }, + /** + * The progress bar has more than one field/value to deal with + * i.e. max_value + * + * @override + * @private + */ + _reset: function () { + this._super.apply(this, arguments); + var new_max_value = this.recordData[this.nodeOptions.max_value]; + this.max_value = new_max_value !== undefined ? new_max_value : this.max_value; + }, isSet: function () { return true; }, |
