Server Function requires refresh to reflect on form

Hi Guys,
I have a function via hook which gets called on validate.

    def fill_bundle_list(doc, method):
    for d in doc.get("items"):
	if frappe.db.get_value("Product Bundle", {"new_item_code": d.item_code}):
            bitems = get_bundle_items(d.item_code)

            for item in bitems:
                prate =frappe.db.get_value("Item Price", {"item_code": item.item_code, "price_list": doc.selling_price_list}, "price_list_rate")
                if not prate:
                    prate = 0
                doc.append("bundle_items",{
                    'item_code':item.item_code,
                    'description':item.description,
                    'qty':item.qty,
                    'rate': prate,
                    'amount': item.qty * prate
                })

On the form, i need to refresh the page manually to see the change. Any idea what I am doing wrong? Bundle Items is a custom table on Standard form Quotation.