There is a module called "Stock by Attributes" in the free Software Add-ons section that may be your solution....