[IMP] web_responsive: Redirect to home after login

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
This commit is contained in:
Angel Patel
2024-06-28 12:19:28 +05:30
parent 618d6740e8
commit c7d59e83b8
10 changed files with 178 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
# Copyright 2023 Taras Shabaranskyi
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import fields, models
from odoo import api, fields, models
class ResUsers(models.Model):
@@ -24,3 +24,19 @@ class ResUsers(models.Model):
default="milk",
required=True,
)
is_redirect_home = fields.Boolean(
string="Redirect to Home",
help="Redirect to dashboard after signing in",
compute="_compute_redirect_home",
store=True,
readonly=False,
)
@api.depends("action_id")
def _compute_redirect_home(self):
"""
Set is_redirect_home to False
when action_id has a value.
:return:
"""
self.filtered("action_id").is_redirect_home = False