Typically you are marking on the Product record whether that product is able to accept a discount or not. But what if you need to do this based on criteria?
This is where Price Rules are great. The simple method is to use Price Condition logic to determine when to make the Quote Line’s Non-discountable field True or False. But you could extend this with a lookup query to look at the Product Code and Parent Product Code to determine if you need to change that field or not.