In many industries, product design and manufacturing lead times are sufficiently long that both the quality level of a product and the amount of inventory produced must be determined before a firm knows what the actual demand will be. In this paper, we conduct a theoretical analysis of such a setting. We first consider a centralized channel and characterize the optimal decisions by establishing relationships that must hold between the elasticity of cost of quality and the elasticity of revenue and show that quality and inventory are strategic substitutes. Next, we consider a decentralized channel with a wholesale price contract, in which a manufacturer determines quality and wholesale price, while a retailer determines inventory and retail price. We find that, different from the case without endogenous inventory, product quality can be higher in a decentralized channel compared to a centralized channel, and this is because a wholesale price contract shields the manufacturer from inventory risk. For both centralized and decentralized channels, we find that as demand uncertainty increases, quality decreases, while, different from the case without endogenous quality, inventory can be U-shaped. Interestingly, to mitigate the impact of demand uncertainty on profit, quality can be a more effective lever than inventory in a centralized channel; however, in a decentralized channel, quality is less responsive and inventory is more responsive to demand uncertainty than in a centralized channel.