-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[17.0][IMP] web_responsive: Redirect to home after login #2864
Conversation
@maintainer_username Could you please review and merge this pull request? I have completed all the required checks, but I don't have the necessary permissions to merge it myself. Thank you! |
Please squash all the commits into one and follow commit message guidelines: https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#commit-message This is |
web_responsive/__manifest__.py
Outdated
@@ -9,14 +9,14 @@ | |||
{ | |||
"name": "Web Responsive", | |||
"summary": "Responsive web client, community-supported", | |||
"version": "17.0.1.0.1", | |||
"version": "17.0.1.0.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change manually the version.
web_responsive/__manifest__.py
Outdated
"category": "Website", | ||
"website": "https://github.com/OCA/web", | ||
"author": "LasLabs, Tecnativa, ITerra, Onestein, " | ||
"Odoo Community Association (OCA)", | ||
"license": "LGPL-3", | ||
"installable": True, | ||
"depends": ["web", "mail"], | ||
"depends": ["base", "web", "mail"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add this dependency.
web_responsive/models/res_users.py
Outdated
@@ -24,3 +24,11 @@ class ResUsers(models.Model): | |||
default="milk", | |||
required=True, | |||
) | |||
is_redirect_home = fields.Boolean( | |||
string="Redirect to Home", | |||
help="Automatically navigate to " "the home dashboard after signing in", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help="Automatically navigate to " "the home dashboard after signing in", | |
help="Automatically navigate to the home dashboard after signing in", |
web_responsive/models/res_users.py
Outdated
|
||
@api.onchange("action_id") | ||
def _onchange_action_id(self): | ||
self.is_redirect_home = self.action_id and self.is_redirect_home |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this onchange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrobaeza
Apply the change to the code as described above. This onchange method will set the value of is_redirect_home to False when the user sets the Home Action under Preferences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, although this can be implemented as a computed writable field for avoiding that this works only by UI. The commit message shouldn't contain the module version, and there's still a comment unattended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrobaeza
Updated as per the suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrobaeza Why do you prefer a compute field instead of a constraint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are complementary. I only prefer computed writable over onchange.
a982ab8
to
aa03b12
Compare
6fe5cbc
to
a75da85
Compare
Could you please initiate the process for the merging stage? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working as expected. Little improvement inline.
A second review is required according OCA guidelines: https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#review
web_responsive/models/res_users.py
Outdated
for user in self: | ||
user.is_redirect_home = False if user.action_id else user.is_redirect_home |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little code improvement:
for user in self: | |
user.is_redirect_home = False if user.action_id else user.is_redirect_home | |
self.filtered("action_id").is_redirect_home = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrobaeza
Updated as per the suggestion.
@pedrobaeza |
Please check the contribution flow: https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#review |
@Patelangel1995 if you're changing module's functional behavior, this should be added to the documentation files |
@francesco-ooops |
@Patelangel1995 ok, now you can squash commits |
@francesco-ooops |
- Redirect to the dashboard after logging in | ||
|
||
![image](../static/img/redirecthome.gif) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redirect to the home page after login will occur only if the user has enabled the 'Redirect to Home' configuration in their user profile settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@francesco-ooops
I've updated it according to the suggestion.
Redirect to the home page after login will occur only if the user has enabled the 'Redirect to Home' configuration in their user profile settings
@Patelangel1995 I see that the feature is accessible only in dev mode. Is this intended? |
@francesco-ooops |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional ok!
This PR has the |
/ocabot merge minor |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 290ec8e. Thanks a lot for contributing to OCA. ❤️ |
Redirect to the home page after login will occur only if the user has enabled the 'Redirect to Home' configuration in their user profile settings.