def METHOD_NAME(self):
    if not self.first_invoice_sent:
        sdi_address = self.env["ir.config_parameter"].get_param(
            "sdi.pec.first.address",
        )
        self.email_exchange_system = sdi_address
    else:
        if not self.email_exchange_system:
            raise exceptions.UserError(
                _(
                    "SDI PEC address not set. Please update it with the "
                    "address indicated by SDI after the first sending"
                )
            )