self.assertEqual(purchase.date_order,po_order_date,'Order date should be equal to: Date of the procurement order - Purchase Lead Time - Delivery Lead Time.')
self.assertEqual(purchase.date_planned,po_schedule_date,'Schedule date should be equal to: Order date of Purchase order + Delivery Lead Time.')
# check the picking created or not
self.assertTrue(purchase.picking_ids,"Picking should be created.")
# Check scheduled date of In Type shipment
self.assertEqual(purchase.picking_ids.scheduled_date,po_schedule_date,'Schedule date of In type shipment should be equal to: schedule date of purchase order.')
deftest_01_product_level_delay(self):
""" To check schedule dates of multiple purchase order line of the same purchase order,
self.assertEqual(order_line_pro_1.date_planned,schedule_date_line_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
self.assertEqual(order_line_pro_2.date_planned,schedule_date_line_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.')
self.assertEqual(purchase2.date_planned,po_schedule_date,'Schedule date of purchase order should be minimum of schedule dates of purchase order lines.')
# Check the picking created or not
self.assertTrue(purchase2.picking_ids,"Picking should be created.")
# Check scheduled date of In Type shipment
self.assertEqual(purchase2.picking_ids.scheduled_date,po_schedule_date,'Schedule date of In type shipment should be same as schedule date of purchase order.')
deftest_02_product_route_level_delays(self):
""" In order to check dates, set product's Delivery Lead Time
andwarehouseroute's delay."""
# Update warehouse_1 with Incoming Shipments 3 steps
self.assertEqual(incoming_shipment.scheduled_date,po_schedule_date,'Schedule date of In type shipment should be same as schedule date of purchase order.')
self.assertEqual(incoming_shipment1.scheduled_date,incoming_shipment1_schedule_date,'Schedule date of Internal Type shipment for input stock location should be equal to: schedule date of purchase order + push rule delay.')
self.assertEqual(incoming_shipment2.scheduled_date,incoming_shipment2_schedule_date,'Schedule date of Internal Type shipment for quality control stock location should be equal to: schedule date of Internal type shipment for input stock location + push rule delay..')