mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-25 01:48:41 -06:00
Merge pull request #121 from savoirfairelinux/8.0-attachments_to_filesystem
[8.0] Fix user timezone in attachments_to_filesystem
This commit is contained in:
commit
11e4a16cac
@ -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