Batch number mandatory error while receiving sub contracted PO although the batch number exists

I have 2 items FG1 and RM1 both are batch tracked. Basically the finished good and the raw material are batch tracked.

  1. Created a finished goods item FG1 ( set batch enabled item property) and also set it
    as a subcontracted item (enable the check box “Supply Raw Materials for Purchase”)
  2. Create a item RM1 ( set batch enabled item property)
  3. Create a supplier “Test Supplier” and also create a warehouse for this supplier
  4. Create a BOM for FG1 with the supplied material RM1
  5. Created a PO for purchase of RM1 item and receive the item. The received item
    now has a batch number with it.
  6. Create a PO for the subcontracted item FG1. Set Supply Raw Materials to “Yes” and set the warehouse
    as “Test Supplier”
  7. Transfer the material to the supplier. ( I have ensured during the stock transfer the
    batch number is getting reflected)
  8. Now receive the sub contracted item FG1 (PO created in step 6). You now get a error
    stating “Batch number is mandatory”

This error happens only when i have set the buying settings as Subcontract->Backflush Raw Materials of Subcontract Based On->BOM