From d4342d733b1eb823eac85bffd0defa74e1dafcb5 Mon Sep 17 00:00:00 2001 From: "Nasreddin (bon)" Date: Fri, 19 Feb 2021 12:17:05 +0000 Subject: [PATCH] [FIX] stock_account: display datetime with user timezone Issue - Install Inventory module - Go to Inventory -> Reporting -> Inventory Valuation - Click on "Inventory At Date" button - Select any date The datetime in breadcrumb is displayed in UTC. Solution Display datetime in current user timezone. opw-2464744 closes odoo/odoo#66721 X-original-commit: 235386e4e6c8a4b55e9bee5dd901c611cd7950da Signed-off-by: bon-odoo --- addons/stock_account/wizard/stock_quantity_history.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock_account/wizard/stock_quantity_history.py b/addons/stock_account/wizard/stock_quantity_history.py index aaddf96734c..1026e7bd8b9 100644 --- a/addons/stock_account/wizard/stock_quantity_history.py +++ b/addons/stock_account/wizard/stock_quantity_history.py @@ -1,6 +1,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models +from odoo.tools.misc import format_datetime class StockQuantityHistory(models.TransientModel): @@ -11,7 +12,7 @@ class StockQuantityHistory(models.TransientModel): if active_model == 'stock.valuation.layer': action = self.env["ir.actions.actions"]._for_xml_id("stock_account.stock_valuation_layer_action") action['domain'] = [('create_date', '<=', self.inventory_datetime), ('product_id.type', '=', 'product')] - action['display_name'] = str(self.inventory_datetime) + action['display_name'] = format_datetime(self.env, self.inventory_datetime) return action return super(StockQuantityHistory, self).open_at_date()