Reading up the changes in WooCommerce 3.0, it seems that is not possible to anymore properties from order items directly, so I would assume that the following code needs to
WC_Order_Item_Product inherits from WC_Order_Item, which has get_order_id(), so you can get the Order ID with
$order_item->get_order_id();