[IMP] hr: do not reset employee timezone if user has no timezone
Purpose of this code is to synchronize user and employee timezones. However if the employee has one and the user none it is better to keep the one set on the employee to avoid issues.
This commit is contained in:
@@ -235,12 +235,14 @@ class Employee(models.Model):
|
||||
self.tz = self.resource_calendar_id.tz
|
||||
|
||||
def _sync_user(self, user):
|
||||
return dict(
|
||||
vals = dict(
|
||||
name=user.name,
|
||||
image=user.image,
|
||||
work_email=user.email,
|
||||
tz=user.tz,
|
||||
)
|
||||
if user.tz:
|
||||
vals['tz'] = user.tz
|
||||
return vals
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
|
||||
Reference in New Issue
Block a user