-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/15.0-develop' into 15.0-develop
- Loading branch information
Showing
12 changed files
with
290 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from . import controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import web_login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from odoo import http | ||
from odoo.tools.translate import _ | ||
|
||
from odoo.addons.web.controllers.main import Home | ||
|
||
|
||
class WebLoginHome(Home): | ||
@http.route() | ||
def web_login(self, redirect=None, **kw): | ||
response = super().web_login() | ||
if "error" in response.qcontext: | ||
error_message = response.qcontext["error"] | ||
if error_message == _("Wrong login/password"): | ||
# Change the error message to your desired message | ||
response.qcontext["error"] = _( | ||
"Login failed due to Invalid credentials !" | ||
) | ||
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import res_company | ||
from . import res_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from odoo import _, models | ||
|
||
|
||
class ResUser(models.Model): | ||
_inherit = "res.users" | ||
|
||
def reset_password(self, login): | ||
"""retrieve the user corresponding to login (login or email), | ||
and reset their password | ||
""" | ||
users = self.search([("login", "=", login)]) | ||
if not users: | ||
users = self.search([("email", "=", login)]) | ||
if len(users) != 1: | ||
raise Exception( | ||
_("Incorrect email. Please enter the registered email address.") | ||
) | ||
return users.action_reset_password() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -434,3 +434,7 @@ main { | |
height: 31px; | ||
color: #ffffff !important; | ||
} | ||
|
||
.info-message { | ||
color: #ed9834; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
main:has(.g2p_login) { | ||
top: 0px; | ||
left: 0px; | ||
width: 100%; | ||
height: 750px; | ||
/* UI Properties */ | ||
background: #fff7dd 0% 0% no-repeat padding-box; | ||
opacity: 1; | ||
} | ||
|
||
.g2p_login .oe_login_form:not(.ssp-signup-body), | ||
.g2p_login .oe_signup_form:not(.ssp-signup-body), | ||
.g2p_login .oe_reset_password_form:not(.ssp-signup-body) { | ||
max-width: 444px !important; | ||
// max-height: 486px; | ||
position: relative; | ||
margin: 50px auto; | ||
top: 100px; | ||
background: #ffffff 0% 0% no-repeat padding-box; | ||
box-shadow: 0px 3px 15px #0000000d; | ||
border-radius: 20px; | ||
opacity: 1; | ||
padding: 25px; | ||
} | ||
|
||
/* Initial button style */ | ||
.g2p_login .oe_login_buttons .btn-primary { | ||
background-color: #e0711a; | ||
border-color: #e0711a; | ||
} | ||
|
||
/* Button hover style */ | ||
.g2p_login .oe_login_buttons .btn-primary:hover { | ||
border-color: #6569c7; | ||
background: #6569c7 0% 0% no-repeat padding-box; | ||
opacity: 1; | ||
} | ||
|
||
/* Button press style */ | ||
.g2p_login .oe_login_buttons .btn-primary:active, | ||
.g2p_login .oe_login_buttons .btn-primary:focus { | ||
background-color: #6569c7 !important; | ||
border-color: #6569c7 !important; | ||
} | ||
|
||
.g2p_login .oe_login_buttons a, | ||
.g2p_login .oe_login_buttons a:hover { | ||
color: #e0711a; | ||
text-decoration: none; | ||
font-size: 13px; | ||
} | ||
|
||
.g2p_login .form-control:focus { | ||
color: #495057; | ||
background-color: #ffffff; | ||
border-color: rgba(224, 113, 26, 0.5) !important; | ||
/* Change the opacity to adjust the brightness */ | ||
box-shadow: 0 0 0 0.1rem rgb(255, 149, 49) !important; | ||
opacity: 1; | ||
} | ||
|
||
.g2p_login .alert-danger { | ||
top: 102px; | ||
max-height: 200px; | ||
left: 50%; /* Center the element horizontally */ | ||
transform: translateX(-50%); /* Center horizontally */ | ||
max-width: 430px; /* Set a maximum width */ | ||
width: 100%; /* Make sure it doesn't exceed the maximum width */ | ||
/* UI Properties */ | ||
background: #db3c3c 0% 0% no-repeat padding-box; | ||
box-shadow: 0px 3px 15px #0000000d; | ||
border-radius: 8px; | ||
opacity: 1; | ||
font-weight: normal; | ||
font-style: normal; | ||
font-size: 14px; | ||
line-height: 17px; | ||
text-align: center; | ||
letter-spacing: 0px; | ||
color: #ffffff; | ||
opacity: 1; | ||
} | ||
|
||
.reset_g2p_pass { | ||
/* Layout Properties */ | ||
top: 353px; | ||
left: 491px; | ||
width: 153px; | ||
height: 24px; | ||
/* UI Properties */ | ||
text-align: left; | ||
font-family: "Inter", sans-serif; | ||
letter-spacing: 0px; | ||
color: #000000; | ||
font-weight: normal; | ||
font-style: normal; | ||
font-size: 20px; | ||
line-height: 24px; | ||
margin: 30px 0 30px; | ||
} | ||
|
||
// .g2p_login .oe_reset_password_form { | ||
// height: 400px !important; | ||
// } | ||
.g2p_login .reset-password, | ||
.g2p_login .reset-password a { | ||
color: #e0711a; | ||
text-decoration: none; | ||
float: right; | ||
font-size: 13px; | ||
} | ||
|
||
.g2p_login form label { | ||
/* Layout Properties */ | ||
top: 406px; | ||
left: 491px; | ||
width: 168px; | ||
height: 17px; | ||
/* UI Properties */ | ||
text-align: left; | ||
font-weight: bolder; | ||
font-family: "Inter", sans-serif; | ||
font-style: normal !important; | ||
font-size: 14px; | ||
line-height: 17px; | ||
letter-spacing: 0px; | ||
color: #000000; | ||
opacity: 1; | ||
} | ||
|
||
.g2p_login .g2p-background { | ||
/* Layout Properties */ | ||
position: absolute; | ||
top: 312px; | ||
left: 227px; | ||
width: 912px; | ||
height: 120px; | ||
/* UI Properties */ | ||
background: transparent url("/g2p_theme/static/src/img/57485.png") 0% 0% no-repeat padding-box; | ||
opacity: 1; | ||
} | ||
|
||
/* Responsive styles for smaller screens */ | ||
@media screen and (max-width: 768px) { | ||
.g2p_login:not(.ssp-signup-body) .alert-danger { | ||
display: block; | ||
} | ||
} | ||
@media screen and (min-width: 769px) { | ||
.g2p_login:not(.ssp-signup-body) .alert-danger { | ||
display: block; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template id="g2p_reset_password" inherit_id="auth_signup.reset_password" name="Inherit Reset password"> | ||
<xpath expr="//form" position="before"> | ||
<div class="g2p-background" /> | ||
<t t-set="no_header" t-value="True" /> | ||
<t t-set="no_footer" t-value="True" /> | ||
</xpath> | ||
<xpath expr="//label[@for='login']" position="replace"> | ||
<label for="name">Your Email / Username</label> | ||
</xpath> | ||
<div class="form-group field-login" position="before"> | ||
<div t-attf-class="text-center pb-3 {{'mb-3' if form_small else 'mb-4'}}"> | ||
<img | ||
t-attf-src="/web/binary/company_logo{{ '?dbname='+db if db else '' }}" | ||
alt="Logo" | ||
style="max-height:120px; max-width: 100%; width:auto" | ||
/> | ||
</div> | ||
<p class="reset_g2p_pass">Reset Password</p> | ||
</div> | ||
<xpath expr="//div[hasclass('oe_login_buttons')]/div" position="attributes"> | ||
<attribute | ||
name="class" | ||
add="justify-content-center" | ||
remove="justify-content-between" | ||
separator=" " | ||
/> | ||
</xpath> | ||
<xpath expr="//form" position="before"> | ||
<xpath expr="//p[@class='alert alert-danger']" position="move" /> | ||
</xpath> | ||
<xpath expr="//p[@class='alert alert-danger']" position="attributes"> | ||
<attribute name="class" add="reset_alert" separator=" " /> | ||
</xpath> | ||
</template> | ||
</odoo> |