[FIX] hr: Expose employee timezone on public profile
Purpose ======= It happens a lot that we access to the employee timezone to compute presence states, leaves, ... Instead of sudoing all those accesses, it looks better to expose this data in the public profile. closes odoo/odoo#35811 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -24,3 +24,6 @@ class HrEmployeeBase(models.AbstractModel):
|
||||
user_id = fields.Many2one('res.users')
|
||||
resource_id = fields.Many2one('resource.resource')
|
||||
resource_calendar_id = fields.Many2one('resource.calendar')
|
||||
tz = fields.Selection(
|
||||
string='Timezone', related='resource_id.tz', readonly=False,
|
||||
help="This field is used in order to define in which timezone the resources will work.")
|
||||
|
||||
@@ -28,6 +28,7 @@ class HrEmployeePublic(models.Model):
|
||||
user_id = fields.Many2one(readonly=True)
|
||||
resource_id = fields.Many2one(readonly=True)
|
||||
resource_calendar_id = fields.Many2one(readonly=True)
|
||||
tz = fields.Selection(readonly=True)
|
||||
|
||||
# hr.employee.public specific fields
|
||||
child_ids = fields.One2many('hr.employee.public', 'parent_id', string='Direct subordinates', readonly=True)
|
||||
|
||||
Reference in New Issue
Block a user