def METHOD_NAME(self, old_persons):
    if self._context.get("recurse_order_calendar"):
        # avoid recursion
        return
    for rec in self:
        with_ctx = rec.calendar_event_id.with_context(recurse_order_calendar=True)
        if old_persons.get(rec.id):
            # remove buddy
            with_ctx.partner_ids = [(3, old_persons[rec.id].partner_id.id, False)]
        if rec.person_id:
            # add the new one
            with_ctx.partner_ids = [(4, rec.person_id.partner_id.id, False)]