From 0aefcdbad77ffe560f24eda0dd5239f0ec9bc645 Mon Sep 17 00:00:00 2001 From: amoyaux Date: Mon, 16 Oct 2017 11:05:24 +0200 Subject: [PATCH] [FIX] stock: procurement generated by scheduler truncate datetime When purchase order are created from a scheduler they always have the same hours even if they were created at different time. Also the procurement order that generate the purchase order line have the same problem. It happens because the transformation from datetime to string use a date format and thus truncate the DEFAULT_SERVER_TIME_FORMAT This commit use a datetime format instead the dateformat. opw-775833 --- addons/stock/models/stock_warehouse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_warehouse.py b/addons/stock/models/stock_warehouse.py index 4dd80595c53..b112d11567b 100644 --- a/addons/stock/models/stock_warehouse.py +++ b/addons/stock/models/stock_warehouse.py @@ -8,7 +8,7 @@ from dateutil import relativedelta from odoo import api, fields, models, _ from odoo.addons import decimal_precision as dp from odoo.exceptions import UserError, ValidationError -from odoo.tools import DEFAULT_SERVER_DATE_FORMAT +from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT import logging @@ -843,7 +843,7 @@ class Orderpoint(models.Model): # These days will be substracted when creating the PO days += self.product_id._select_seller().delay or 0.0 date_planned = start_date + relativedelta.relativedelta(days=days) - return date_planned.strftime(DEFAULT_SERVER_DATE_FORMAT) + return date_planned.strftime(DEFAULT_SERVER_DATETIME_FORMAT) @api.multi def _prepare_procurement_values(self, product_qty, date=False, group=False):