Seems like this would work.
SELECT CompanyCode, ModelID, ModelDescription, Quantity FROM CustomerProduct WHERE ID = 123
AND (@FromYear IS NULL OR FromYear = @FromYear)
AND (@ToYear IS NULL OR ToYear = @ToYear)
Or perhaps this, but profile to see which performs better.
SELECT CompanyCode, ModelID, ModelDescription, Quantity FROM CustomerProduct WHERE ID = 123
AND FromYear = ISNULL(@FromYear, FromYear)
AND ToYear = ISNULL(@ToYear, ToYear)