diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2021-02-19 12:17:05 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2021-02-23 15:25:11 +0000 |
| commit | 2c9f91988aacdf2eb76dccb1aaebea34425e9437 (patch) | |
| tree | a92c95aac6252225e8c598fbd13b5d9662ecc753 | |
| parent | 67dc3b2a1f1a1ca938682706bf1fc20c511d4ab0 (diff) | |
[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#66713
X-original-commit: 235386e4e6c8a4b55e9bee5dd901c611cd7950da
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
| -rw-r--r-- | addons/stock_account/wizard/stock_quantity_history.py | 3 |
1 files changed, 2 insertions, 1 deletions
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() |
