diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2018-10-04 10:26:57 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2018-10-04 10:38:53 +0000 |
| commit | 23bec7fb7f8daf1252b85f22827112591d72818d (patch) | |
| tree | 8c1e84ac1498112b7373cc284ae92800b1b54072 /addons/auth_password_policy | |
| parent | 1868713dbd07e0b518f91dffe73e62d85e6ab9a6 (diff) | |
[FIX] auth_password_policy: remove deferred when not needed
When auth_password_policy is installed, and a field with
`password="True"` is in a res.config.settings (eg. google calendar is
installed) we could have an error caused by deferred not expected in the
res.config.settings _render.
Since the RPC is only needed when the password_policy has been been
defined, this commit do this removing the error that currently happened.
A customization of res.config.settings adding password_meter would still
break settings (but it is currently not done) and will be solved in a
future fix.
closes #27426
Diffstat (limited to 'addons/auth_password_policy')
| -rw-r--r-- | addons/auth_password_policy/static/src/js/password_field.js | 4 |
1 files changed, 2 insertions, 2 deletions
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 29db6449442..93a623acc1c 100644 --- a/addons/auth_password_policy/static/src/js/password_field.js +++ b/addons/auth_password_policy/static/src/js/password_field.js @@ -21,12 +21,12 @@ var PasswordField = fields.InputField.extend({ }, willStart: function () { var _this = this; - var getPolicy = this._rpc({ + var getPolicy = this.nodeOptions['password_meter'] ? this._rpc({ model: 'res.users', method: 'get_password_policy', }).then(function (p) { _this._meter = new Meter(_this, new policy.Policy(p), policy.recommendations); - }); + }) : undefined; return $.when( this._super.apply(this, arguments), getPolicy |
