diff --git a/addons/auth_password_policy/static/src/js/change_password.js b/addons/auth_password_policy/static/src/js/change_password.js index 1a6e7faaafc..0a40f4bd39d 100644 --- a/addons/auth_password_policy/static/src/js/change_password.js +++ b/addons/auth_password_policy/static/src/js/change_password.js @@ -18,16 +18,16 @@ ChangePassword.include({ }).then(function (p) { _this._meter = new Meter(_this, new policy.Policy(p), policy.recommendations); }); - return $.when( + return Promise.all([ this._super.apply(this, arguments), getPolicy - ); + ]); }, start: function () { - return $.when( + return Promise.all([ this._meter.insertAfter(this.$('input[name=new_password]')), this._super() - ); + ]); } }) }); diff --git a/addons/auth_password_policy/static/src/js/password_field.js b/addons/auth_password_policy/static/src/js/password_field.js index fa8cfd20ff2..f0aa2c4420e 100644 --- a/addons/auth_password_policy/static/src/js/password_field.js +++ b/addons/auth_password_policy/static/src/js/password_field.js @@ -28,10 +28,10 @@ var PasswordField = fields.InputField.extend({ }).then(function (p) { _this._meter = new Meter(_this, new policy.Policy(p), policy.recommendations); }); - return $.when( + return Promise.all([ this._super.apply(this, arguments), getPolicy - ); + ]); }, /** * Add a next to the input (TODO: move to template?) @@ -42,7 +42,7 @@ var PasswordField = fields.InputField.extend({ _renderEdit: function () { var _this = this; var meter = this._meter; - return $.when(this._super.apply(this, arguments)).then(function () { + return Promise.resolve(this._super.apply(this, arguments)).then(function () { return meter._widgetRenderAndInsert(function (t) { // insertAfter doesn't work and appendTo means the meter is // ignored (as this.$el is an input[type=password])