[MIG] web_responsive: Migration to 15.0

This commit is contained in:
Sergey Shebanin
2021-10-21 17:40:06 +03:00
parent 6ebff91b59
commit 62722a7a2f
42 changed files with 2236 additions and 2415 deletions

View File

@@ -9,19 +9,18 @@ class ResUsers(models.Model):
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"])
"""Override to add access rights.
Access rights are disabled by default, but allowed on some specific
fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
"""
@property
def SELF_READABLE_FIELDS(self):
return super().SELF_READABLE_FIELDS + ["chatter_position"]
@property
def SELF_WRITEABLE_FIELDS(self):
return super().SELF_WRITEABLE_FIELDS + ["chatter_position"]