In 'Settings/Users/Access management', enable the right: 'Manage product serial numbers'.
In a stock order, for each product line, you can add a serial number in the S/N field. Each product should be added as a single line.
In a sale, for each product line, you can enter the serial number in the S/N field.
In each product form, you can track a serial number in the S/N section to get information about the initial stock order and the final sale.