Show Reset Password button for users on the login page

This commit is contained in:
Mazen Abdo 2025-11-09 14:40:26 +02:00
parent ca1573ad50
commit 480bcdcf35
5 changed files with 17 additions and 7 deletions

View File

@ -98,6 +98,7 @@ class Home(http.Controller):
background = param_obj.get_param('mpl_login_background.background')
values['background_color'] = param_obj.get_param('mpl_login_background.color')
b_image = param_obj.get_param('mpl_login_background.b_image')
values['reset_password_enabled'] = param_obj.get_param('auth_signup.reset_password') == 'True'
if background == 'image':
image_url = ''

View File

@ -60,6 +60,9 @@
<div t-attf-class="clearfix oe_login_buttons text-center mb-1 {{'pt-2' if form_small else 'pt-3'}}">
<button type="submit" class="btn btn-primary btn-block">Log in</button>
<t t-if="reset_password_enabled">
<a t-attf-href="/web/reset_password?{{ keep_query() }}" class="btn btn-secondary btn-block">Reset Password</a>
</t>
<t t-if="debug">
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
</t>

View File

@ -64,6 +64,9 @@
<div t-attf-class="clearfix oe_login_buttons text-center mb-1 {{'pt-2' if form_small else 'pt-3'}}">
<button type="submit" class="btn btn-primary btn-block">Log in</button>
<t t-if="reset_password_enabled">
<a t-attf-href="/web/reset_password?{{ keep_query() }}" class="btn btn-secondary btn-block">Reset Password</a>
</t>
<t t-if="debug">
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
</t>

View File

@ -60,6 +60,9 @@
<div t-attf-class="clearfix oe_login_buttons text-center mb-1 {{'pt-2' if form_small else 'pt-3'}}">
<button type="submit" class="btn btn-primary btn-block">Log in</button>
<t t-if="reset_password_enabled">
<a t-attf-href="/web/reset_password?{{ keep_query() }}" class="btn btn-secondary btn-block">Reset Password</a>
</t>
<t t-if="debug">
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm btn-block">Log in as superuser</button>
</t>

View File

@ -10,10 +10,10 @@ class BaseModuleUninstall(models.TransientModel):
is_restrict = fields.Boolean()
password = fields.Char(required=True)
def action_uninstall(self):
if not tools.config.get('uninstall_password'):
raise ValidationError("Uninstall password not yet set!")
if self.password != tools.config.get('uninstall_password').replace('\'', ''):
raise ValidationError("Invalid Password!")
return super(BaseModuleUninstall, self).action_uninstall()
#
# def action_uninstall(self):
# if not tools.config.get('uninstall_password'):
# raise ValidationError("Uninstall password not yet set!")
# if self.password != tools.config.get('uninstall_password').replace('\'', ''):
# raise ValidationError("Invalid Password!")
# return super(BaseModuleUninstall, self).action_uninstall()