This depends what you goal is. This could be better stock control but you want to continue to have the convenience of separate codes, especially if your products are already barcoded with carton and individual item codes. Or if that is not the case or you wish to reduce the total number of codes you want to work with, then you could try working with multiple units of measure.
For retaining separate codes but better managing your stock control, create a "physical" stock item for the smallest unit of measure you hold in stock and sell, and then create stock kits based on this code. So you have code ABC which is your individual sale unit and ABCCARTON (which is a kit) which is set to deduct 10 ABC units for each ABCCARTON unit sold. Simply create a kit called ABCCARTON and specify it consists of 10 units of ABC.
Another approach is to start working in multiple units of measure, so you then only have one ABC code in the system but you must then specify the unit of measure if the default unit is not sold. I.e., 2CARTON, 3BOX, 2DOZ and so on. This is more complex to set-up but is a good way to manage your stock and reduce the total number of individual codes in the system. For more information on this, read up on the topics that reference "Box Dimensions"