From e0f02cf438d8852461fa22a1ff88859afee4e9a5 Mon Sep 17 00:00:00 2001 From: Florent de Labarre Date: Tue, 20 Jul 2021 07:23:28 +0000 Subject: [PATCH] [FIX] stock: date and float are not correctly show In the popover date and float are wrongly formatted. This PR format date and float according to the user language. closes odoo/odoo#74032 X-original-commit: a46f8d66965cce5759ca4af17c71b0aa18eda9ec Signed-off-by: Arnold Moyaux --- addons/stock/wizard/stock_replenishment_info.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/stock/wizard/stock_replenishment_info.py b/addons/stock/wizard/stock_replenishment_info.py index a7ddfe58acd..950a788a16d 100644 --- a/addons/stock/wizard/stock_replenishment_info.py +++ b/addons/stock/wizard/stock_replenishment_info.py @@ -6,7 +6,7 @@ from datetime import datetime, time from odoo import api, fields, models, SUPERUSER_ID from odoo.osv.expression import AND -from odoo.tools.date_utils import get_month, subtract +from odoo.tools import get_month, subtract, format_date class StockReplenishmentInfo(models.TransientModel): @@ -31,14 +31,14 @@ class StockReplenishmentInfo(models.TransientModel): orderpoint.product_id, **orderpoints_values) replenishment_report.json_lead_days = dumps({ 'template': 'stock.leadDaysPopOver', - 'lead_days_date': fields.Date.to_string(replenishment_report.orderpoint_id.lead_days_date), + 'lead_days_date': format_date(replenishment_report.orderpoint_id.lead_days_date), 'lead_days_description': lead_days_description, - 'today': fields.Date.to_string(fields.Date.today()), + 'today': format_date(fields.Date.today()), 'trigger': orderpoint.trigger, - 'qty_forecast': orderpoint.qty_forecast, - 'qty_to_order': orderpoint.qty_to_order, - 'product_min_qty': orderpoint.product_min_qty, - 'product_max_qty': orderpoint.product_max_qty, + 'qty_forecast': self.env['ir.qweb.field.float'].value_to_html(orderpoint.qty_forecast, {'decimal_precision': 'Product Unit of Measure'}), + 'qty_to_order': self.env['ir.qweb.field.float'].value_to_html(orderpoint.qty_to_order, {'decimal_precision': 'Product Unit of Measure'}), + 'product_min_qty': self.env['ir.qweb.field.float'].value_to_html(orderpoint.product_min_qty, {'decimal_precision': 'Product Unit of Measure'}), + 'product_max_qty': self.env['ir.qweb.field.float'].value_to_html(orderpoint.product_max_qty, {'decimal_precision': 'Product Unit of Measure'}), 'product_uom_name': orderpoint.product_uom_name, 'virtual': orderpoint.trigger == 'manual' and orderpoint.create_uid.id == SUPERUSER_ID, })