Enable lots from settings.

2.Enable it in sales also (attention! Only where we have exported goods(sales) will the window appear to select from which batch we will take out the product.)

And then when we put the product in the document it will bring it to us as in the picture below and so we can choose from which batch we will remove our product.