-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathres_users.py
43 lines (38 loc) · 1.12 KB
/
res_users.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright 2023 Taras Shabaranskyi
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
class ResUsers(models.Model):
_inherit = "res.users"
apps_menu_search_type = fields.Selection(
[
("canonical", "Canonical"),
("fuse", "Fuse"),
("command_palette", "Command Palette"),
],
default="canonical",
required=True,
)
apps_menu_theme = fields.Selection(
[
("milk", "Milk"),
("community", "Community"),
],
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,
)
display_file_viewer = fields.Boolean()
@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