[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:
Thibault Delavallée
2018-09-13 12:19:29 +02:00
parent 8fad1e51ca
commit d74fe36654
+4 -2
View File
@@ -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):