Skip to content

Commit

Permalink
Merge PR #107 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Feb 23, 2024
2 parents 84562b9 + b015725 commit 140c8c4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hr_holidays_summary_email/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,17 @@ class ResUser(models.Model):
hr_leave_summary_type = fields.Selection(
related="employee_id.hr_leave_summary_type", readonly=False, related_sudo=False
)

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(ResUser, self).__init__(pool, cr)
# duplicate list to avoid modifying the original reference
type(self).SELF_READABLE_FIELDS = type(self).SELF_READABLE_FIELDS + [
"hr_leave_summary_type"
]
type(self).SELF_WRITEABLE_FIELDS = type(self).SELF_WRITEABLE_FIELDS + [
"hr_leave_summary_type"
]

0 comments on commit 140c8c4

Please sign in to comment.