A Contract, which can be cancelled without paying compensation to the other party, involves no performance obligation and hence can never be an onerous contract.
The following is an example of an onerous contract.
On 1st October 2016, Organisation A enters into a contract with organisation B to supply 100 Kgs of wheat at Rs 35 per kg. The wheat is to be supplied on 31st October, 2016.
Organisation A has no stock of wheat on hand. However, it expects to receive a consignment of wheat on 15th October, 2016 at Rs 30 per Kg.
On 15th of October, due to an acute supply constraint, the consignment does not arrive. Now, in order to meet the obligations under the contract, Organisation A has to procure the wheat from the open Market. The cost of procurement for organisation A on that date is Rs 40 per Kg.
Thus, on 15th of October, the contract for Organisation A takes the shape of an onerous contract. This is because the cost of meeting the obligations under the contract i.e procure 100 kg of wheat from the open market at Rs. 40 per kg exceeds the benefits (selling price of Rs. 35 per Kg) expected to received from the contract.
Accounting treatment of an onerous contract.
As per IND AS 37 - Provisions, Contingent Liabilities and Contingent Assets, "If an entity has a contract that is onerous, the present obligation under the contract shall be recognised and measured as a provision."