Password field should visible if LDAP is using

authentications = ldap

If we use above session then Password field and reset password button will hide from User form.

But I want to build a feature from which If we change password from tryton then LDAP password should change also.

So for that I want to show Password field and reset password button on user form.

I try to do it via adding a password field using inheritance, but Field wasn’t visible.

So anyone can guide me how I can show Password field and reset password button on user form ?

The field is hidden using the states attribute. In your module, you can just update the invisible state to be False if ldap is in the authentications. This can be done in the __setup__ method of the User class.


After Khushboo, I was working on the above case today. I couldn’t help but notice that the ldap_authentication module deliberately prevents the user to change password for the ldap users. (ref What could be the rationale behind it ? Shouldn’t the tryton interface allow the password to be modified for an ldap user ?

Because it will be ambiguous, is it changing the password in Tryton database or on the LDAP server.
Also user may not understand the consequences of changing the password on the LDAP such that all other application will have their “password” also changed.
And finally, there are not a unique way to change the password in an LDAP server.

1 Like

@ced Thanks for the reply !!