'Return the available and published delivery carriers'

def _get_delivery_methods(self):

    self.ensure_one()
    available_carriers = DeliveryCarrier = self.env['delivery.carrier']
    carrier_ids = DeliveryCarrier.sudo().search([('website_published', '=', True)]).ids
    for carrier_id in carrier_ids:
        carrier = DeliveryCarrier.browse(carrier_id)
        try:
            _logger.debug(('Checking    availability    of    carrier    #%s' % carrier_id))
            available = carrier.with_context(order_id=self.id).read(fields=['available'])[0]['available']
            if available:
                available_carriers += carrier
        except ValidationError as e:
            _logger.debug(('Carrier    #%s    removed    from    e-commerce    carrier    list.    %s' % (carrier_id, e)))
    return available_carriers
