summaryrefslogtreecommitdiff
path: root/addons/purchase_stock/tests
diff options
context:
space:
mode:
authoryhu-odoo <yhu@odoo.com>2020-06-08 17:42:28 +0000
committeryhu-odoo <yhu@odoo.com>2020-06-09 14:22:51 +0000
commit85f3c08039b687b2a32f7a1b970bc2aa84d5fe10 (patch)
treef85abffc415c9b1955d00cac8af6c975f3c48ed2 /addons/purchase_stock/tests
parentf48aad5944e0a8516efc838eb31ce1d79079687f (diff)
[IMP] purchase: set scheduled date to the last minute of that day
When set scheduled date on PO line, set it to be the last minute of that day to correctly decide the late of the receipt. Task 2265912 PR #52693 Related: odoo/enterprise#11034 Related: odoo/upgrade#1323 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/purchase_stock/tests')
-rw-r--r--addons/purchase_stock/tests/test_purchase_lead_time.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/purchase_stock/tests/test_purchase_lead_time.py b/addons/purchase_stock/tests/test_purchase_lead_time.py
index f01aad815e3..e42e2104733 100644
--- a/addons/purchase_stock/tests/test_purchase_lead_time.py
+++ b/addons/purchase_stock/tests/test_purchase_lead_time.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, time
from unittest.mock import patch
from odoo import fields
@@ -33,7 +33,7 @@ class TestPurchaseLeadTime(PurchaseTestCommon):
self.assertEqual(purchase.date_order, order_date, 'Order date should be equal to: Date of the procurement order - Purchase Lead Time - Delivery Lead Time.')
# Check scheduled date of purchase order
- schedule_date = order_date + timedelta(days=self.product_1.seller_ids.delay)
+ schedule_date = datetime.combine(order_date + timedelta(days=self.product_1.seller_ids.delay), time.max).replace(microsecond=0, second=0)
self.assertEqual(purchase.order_line.date_planned, schedule_date, 'Schedule date should be equal to: Order date of Purchase order + Delivery Lead Time.')
# check the picking created or not
@@ -70,11 +70,11 @@ class TestPurchaseLeadTime(PurchaseTestCommon):
self.assertEqual(purchase2.date_order, order_date, 'Order date should be equal to: Date of the procurement order - Delivery Lead Time.')
# Check scheduled date of purchase order line for product_1
- schedule_date_1 = order_date + timedelta(days=self.product_1.seller_ids.delay)
+ schedule_date_1 = datetime.combine(order_date + timedelta(days=self.product_1.seller_ids.delay), time.max).replace(microsecond=0, second=0)
self.assertEqual(order_line_pro_1.date_planned, schedule_date_1, 'Schedule date of purchase order line for product_1 should be equal to: Order date of purchase order + Delivery Lead Time of product_1.')
# Check scheduled date of purchase order line for product_2
- schedule_date_2 = order_date + timedelta(days=self.product_2.seller_ids.delay)
+ schedule_date_2 = datetime.combine(order_date + timedelta(days=self.product_2.seller_ids.delay), time.max).replace(microsecond=0, second=0)
self.assertEqual(order_line_pro_2.date_planned, schedule_date_2, 'Schedule date of purchase order line for product_2 should be equal to: Order date of purchase order + Delivery Lead Time of product_2.')
# Check scheduled date of purchase order