[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 <nboulif@users.noreply.github.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user