mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-23 04:22:04 -06:00
Fix user timezone in attachments_to_filesystem
This commit is contained in:
parent
f27a5befe2
commit
016d0be817
@ -61,7 +61,8 @@ class IrAttachment(Model):
|
||||
user = self.pool['res.users'].browse(cr, uid, uid, context=context)
|
||||
next_night = datetime.now() + relativedelta(
|
||||
hour=01, minute=42, second=0)
|
||||
next_night = pytz.timezone(user.tz).localize(next_night).astimezone(
|
||||
user_tz = user.tz or 'UTC'
|
||||
next_night = pytz.timezone(user_tz).localize(next_night).astimezone(
|
||||
pytz.utc).replace(tzinfo=None)
|
||||
if next_night < datetime.now():
|
||||
next_night += relativedelta(days=1)
|
||||
|
Loading…
Reference in New Issue
Block a user