'When removing a full reconciliation, we need to revert the eventual journal entries we created to book the
fluctuation of the foreign currency\'s exchange rate.
We need also to reconcile together the origin currency difference line and its reversal in order to completly
cancel the currency difference entry on the partner account (otherwise it will still appear on the aged balance
for example).'

@api.multi
def unlink(self):

    for rec in self:
        if ((not rec.exchange_move_id) or (not rec.exchange_partial_rec_id)):
            continue
        reversed_move_id = rec.exchange_move_id.reverse_moves()[0]
        reversed_move = self.env['account.move'].browse(reversed_move_id)
        for aml in reversed_move.line_ids:
            if aml.account_id.reconcile:
                break
        if aml:
            precision = ((aml.currency_id and aml.currency_id.rounding) or aml.company_id.currency_id.rounding)
            if (aml.debit or (float_compare(aml.amount_currency, 0, precision_rounding=precision) == 1)):
                pair_to_rec = (aml | rec.exchange_partial_rec_id.credit_move_id)
            else:
                pair_to_rec = (aml | rec.exchange_partial_rec_id.debit_move_id)
            rec.exchange_partial_rec_id.with_context(full_rec_lookup=False).unlink()
            pair_to_rec.reconcile()
    return super(AccountFullReconcile, self).unlink()
