summaryrefslogtreecommitdiff
path: root/web_responsive/models
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
commit1ca3b3df3421961caec3b747a364071c80f5c7da (patch)
tree6778a1f0f3f9b4c6e26d6d87ccde16e24da6c9d6 /web_responsive/models
parentb57188be371d36d96caac4b8d65a40745c0e972c (diff)
initial commit
Diffstat (limited to 'web_responsive/models')
-rw-r--r--web_responsive/models/__init__.py1
-rw-r--r--web_responsive/models/res_users.py27
2 files changed, 28 insertions, 0 deletions
diff --git a/web_responsive/models/__init__.py b/web_responsive/models/__init__.py
new file mode 100644
index 0000000..8835165
--- /dev/null
+++ b/web_responsive/models/__init__.py
@@ -0,0 +1 @@
+from . import res_users
diff --git a/web_responsive/models/res_users.py b/web_responsive/models/res_users.py
new file mode 100644
index 0000000..5247df6
--- /dev/null
+++ b/web_responsive/models/res_users.py
@@ -0,0 +1,27 @@
+# Copyright 2018-2019 Alexandre Díaz
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+
+from odoo import fields, models
+
+
+class ResUsers(models.Model):
+ _inherit = "res.users"
+
+ chatter_position = fields.Selection(
+ [("normal", "Normal"), ("sided", "Sided")],
+ string="Chatter Position",
+ default="sided",
+ )
+
+ def __init__(self, pool, cr):
+ """Override of __init__ to add access rights.
+ Access rights are disabled by default, but allowed on some specific
+ fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
+ """
+ super().__init__(pool, cr)
+ # duplicate list to avoid modifying the original reference
+ type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
+ type(self).SELF_WRITEABLE_FIELDS.extend(["chatter_position"])
+ # duplicate list to avoid modifying the original reference
+ type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
+ type(self).SELF_READABLE_FIELDS.extend(["chatter_position"])