def METHOD_NAME(self, values):
    """Log an exception in invoice's chatter when sending fails.
    If an exception already exists it is update otherwise a new one
    is created.
    """
    activity_type = "account_invoice_export.mail_activity_transmit_warning"
    activity = self.activity_reschedule(
        [activity_type], date_deadline=fields.Date.today()
    )
    if not activity:
        message = self.env.ref(
            "account_invoice_export.exception_sending_invoice"
        )._render(values=values)
        activity = self.activity_schedule(
            activity_type, summary="Job error sending invoice", note=message
        )
    error_log = values.get("error_detail")
    if not error_log:
        error_log = _("An error of type {} occured.").format(
            values.get("error_type")
        )
    activity.note += "<div class='mt16'><p>{}</p></div>".format(error_log)