Skip to content
Snippets Groups Projects
Commit 235386e4 authored by Nasreddin (bon)'s avatar Nasreddin (bon)
Browse files

[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#66533

Signed-off-by: default avatarbon-odoo <nboulif@users.noreply.github.com>
parent 9e0f8c04
No related branches found
No related tags found
No related merge requests found
# 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.ref('stock_account.stock_valuation_layer_action').read()[0]
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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment