Set 'cancelled' state on processed sale/purchase in case of every moves or lines are ignored
When all shipment linked to a sale or purchase are cancelled, sale/purchase state is 'Done' and shipment state is 'Sent'.
In such case, state should be 'Cancelled' (by adding a transition from 'processing' to 'cancelled') and invoice/shipment states should be 'None'.