def METHOD_NAME(self, values):
    values = values.copy()
    carrier_id = values.get("carrier_id")
    option_ids = values.get("option_ids")
    if carrier_id and not option_ids:
        carrier = self.env["delivery.carrier"].browse(carrier_id)
        options = self._get_options_to_add(carrier)
        if options:
            values.update(option_ids=[(6, 0, options.ids)])
    return values