In this paper, we propose a new protocol which integrates intra-flow network coding based opportunistic routing with inter-flow network coding, called CAOR, for lossy wireless networks. In a lossy environment, each linear combination of packets in a batch may not be able to arrive at each forwarder intact. The challenge of this problem is to determine which packets to be XORed for transmissions at each forwarder based on the partially received packets within all combinations (i.e., coded packets). The design goal of our solution is to reduce the number of transmissions and to increase coding opportunity through finding a proper set of packets which can increase the innovative probability for downstream nodes while ensuring the decodability for upstream nodes. The simulation results show that CAOR achieves an average throughput 20% to 30% higher than existing work. Moreover, CAOR also reduces on the average 20% of the number of transmissions for sending a batch of packets.