Adding Options for custom field

I customized one Opportunity doctype with one custom field with the name custom_test I wrote a code for that, and it’s working fine but it’s not reflecting on the opportunity custum_field in customize form what is the issue help regarding this topic

import frappe

def update_custom_select_field():
    sales_stages = frappe.get_all("Sales Stage", filters={}, fields=["stage_name"])
    stage_names = [stage.get("stage_name") for stage in sales_stages]

    opportunity_meta = frappe.get_meta("Opportunity")
    custom_select_field = None

    for field in opportunity_meta.fields:
        if field.fieldname == "custom_test":
            custom_select_field = field

    if custom_select_field:
        # Set the options for the custom select field as a list of strings
        custom_select_field.options = "\n".join(stage_names)

        # Print some debugging information
        print("Before saving meta:")

        # Save the modified meta

        print("After saving meta:")
        print("custom_test field not found in Opportunity doctype.")

# Call the function to update the custom select field options