diff --git a/addons/stock_calendar/test/orderpoint_calendar.yml b/addons/stock_calendar/test/orderpoint_calendar.yml index c95b5ca7222..23e358b79eb 100644 --- a/addons/stock_calendar/test/orderpoint_calendar.yml +++ b/addons/stock_calendar/test/orderpoint_calendar.yml @@ -1,3 +1,9 @@ +- + Create a partner +- + !record {model: res.partner, id: res_partner_cal}: + name: Supplier + supplier: 1 - Create a calendar - @@ -14,7 +20,7 @@ !record {model: product.product, id: product_calendar}: name: Calendar Product seller_ids: - - name: base.res_partner_2 + - name: res_partner_cal delay: 1 orderpoint_ids: - name: Product A Truck @@ -27,7 +33,7 @@ - !record {model: stock.picking, id: pick_out_calendar}: name: Delivery order for procurement - partner_id: base.res_partner_2 + partner_id: res_partner_cal picking_type_id: stock.picking_type_out move_lines: - product_id: product_calendar @@ -40,7 +46,7 @@ - !record {model: stock.picking, id: pick_out_calendar2}: name: Delivery order for procurement - partner_id: base.res_partner_2 + partner_id: res_partner_cal picking_type_id: stock.picking_type_out move_lines: - product_id: product_calendar @@ -53,7 +59,7 @@ - !record {model: stock.picking, id: pick_out_calendar3}: name: Delivery order for procurement - partner_id: base.res_partner_2 + partner_id: res_partner_cal picking_type_id: stock.picking_type_out move_lines: - product_id: product_calendar @@ -88,5 +94,6 @@ procurement = proc_obj.browse(cr, uid, proc_ids[0]) assert procurement.product_qty == 17, 'It should have taken the two first pickings into account for the virtual stock for the orderpoint, not the third' assert datetime.datetime.strptime(procurement.next_delivery_date, DEFAULT_SERVER_DATETIME_FORMAT).weekday() == 3, 'The next delivery date should be on a Thursday' - assert datetime.datetime.strptime(procurement.purchase_line_id.date_planned, DEFAULT_SERVER_DATETIME_FORMAT).weekday() == 4, 'Check it has been put on the purchase line also' + purchase_line_id_date_planned = datetime.datetime.strptime(procurement.purchase_line_id.date_planned, DEFAULT_SERVER_DATETIME_FORMAT).weekday() + assert purchase_line_id_date_planned == 3, 'Check it has been put on the purchase line also, got %d' %purchase_line_id_date_planned