Remove timezone info after converting datetime in UTC
The datetime are always in UTC without tzinfo so they can be compared with the data from the database. Closes #12262
This commit is contained in:
1 parent
6b70ecf0f3
commit
399b443831
1 file changed
+2
-1
@@ -235,7 +235,8 @@ class Product(StockMixin, object, metaclass=PoolMeta):
|
||||
context['_datetime'] = (
|
||||
context['_datetime']
|
||||
.replace(tzinfo=timezone)
|
||||
.astimezone(tz.UTC))
|
||||
.astimezone(tz.UTC)
|
||||
.replace(tzinfo=None))
|
||||
except OverflowError:
|
||||
pass
|
||||
# The date could be before the product creation
|
||||
|
||||
Reference in new issue
Block a user