From f0387d4e7779f34e06c1a037a02141ad20d55847 Mon Sep 17 00:00:00 2001 From: Ajmal JK Date: Sat, 15 Feb 2020 12:12:24 +0530 Subject: [PATCH] [FIX] Bug Fixed 'export_stockinfo_xls' --- export_stockinfo_xls/__manifest__.py | 2 +- export_stockinfo_xls/doc/RELEASE_NOTES.md | 6 +++++- export_stockinfo_xls/models/wizard.py | 7 ++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/export_stockinfo_xls/__manifest__.py b/export_stockinfo_xls/__manifest__.py index 665e6395e..0948169cc 100644 --- a/export_stockinfo_xls/__manifest__.py +++ b/export_stockinfo_xls/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Export Product Stock in Excel', - 'version': '13.0.1.1.1', + 'version': '13.0.1.1.2', 'summary': "Current Stock Report for all Products in each Warehouse", 'description': "Current Stock Report for all Products in each Warehouse, Odoo 13,Odoo13", 'category': 'Warehouse', diff --git a/export_stockinfo_xls/doc/RELEASE_NOTES.md b/export_stockinfo_xls/doc/RELEASE_NOTES.md index 29d1d622e..512176183 100644 --- a/export_stockinfo_xls/doc/RELEASE_NOTES.md +++ b/export_stockinfo_xls/doc/RELEASE_NOTES.md @@ -17,7 +17,11 @@ Updation Of Export Product Stock in Excel #### UPDT Changed to query - +#### 05.02.2020 +#### Version 13.0.1.1.2 +#### UPDT +Set Timezone 'UTC' for default + diff --git a/export_stockinfo_xls/models/wizard.py b/export_stockinfo_xls/models/wizard.py index ee86f254c..7f1de6591 100644 --- a/export_stockinfo_xls/models/wizard.py +++ b/export_stockinfo_xls/models/wizard.py @@ -19,6 +19,7 @@ # If not, see . # ############################################################################# +import time from datetime import date, datetime import pytz import json @@ -163,9 +164,9 @@ class StockReport(models.TransientModel): w_house = w_house.join(get_warehouse[0]) sheet.merge_range(5, 2, 5, 3 + len(get_warehouse[0]), w_house, format4) user = self.env['res.users'].browse(self.env.uid) - tz = pytz.timezone(user.tz) - time = pytz.utc.localize(datetime.datetime.now()).astimezone(tz) - sheet.merge_range('A8:G8', 'Report Date: ' + str(time.strftime("%Y-%m-%d %H:%M %p")), format1) + tz = pytz.timezone(user.tz if user.tz else 'UTC') + times = pytz.utc.localize(datetime.datetime.now()).astimezone(tz) + sheet.merge_range('A8:G8', 'Report Date: ' + str(times.strftime("%Y-%m-%d %H:%M %p")), format1) sheet.merge_range(7, 7, 7, count, 'Warehouses', format1) sheet.merge_range('A9:G9', 'Product Information', format11) w_col_no = 6