'When removing a partial reconciliation, also unlink its full reconciliation if it exists'

@api.multi
def unlink(self):

    to_unlink = self
    full_to_unlink = self.env['account.full.reconcile']
    res = True
    if self._context.get('full_rec_lookup', True):
        for rec in self:
            if self.env['account.full.reconcile'].search([('exchange_partial_rec_id', '=', rec.id)]):
                to_unlink = (to_unlink - rec)
            if rec.full_reconcile_id:
                full_to_unlink |= rec.full_reconcile_id
    if to_unlink:
        res = super(AccountPartialReconcile, to_unlink).unlink()
    if full_to_unlink:
        full_to_unlink.unlink()
    return res
