How to keep track of bags, cans, drums of inventory?

How to keep track of bags, cans, drums of inventory?

We buy and sell products that are packaged in bags 🛍️, cans🥫, drums🛢️, etc.  with batch numbers.  When we get a shipment of one of the products, how do we track we received (say) 10 cans each of 5L of a product and maybe we received 10 cans of another product but with each of 20L size?
We want to ensure that when we sell, we sell in multiples of 5L for the first product and multiples of 20L for the second product!