I think claiming discount will not be rational but can be claimed if it's regular in practice of the trade. Otherwise raising a debit note is a perfect way.
But as clearly mentioned in query party has deducted amount because of bad quality it means it will not pay the amount even if debit note is been raised
Yes absolutely party will not give any money to the vendor and the reason being poor quality and not in the nature of any cash discount or trade discount. That's why I think it will be more appropriate to raise debit note. It is also according to trade practices.