How to refresh submitted doctype


I have doctype x which is submitted and i updated one field in x say due_amount via other doctype y

but when i take submitted doc x again the due_amount is not updated but it will update when i refresh the doc type

what have i tried is

what i have done to update due_amount is

in i wrote following code

def on_submit(self):
    ohb = frappe.get_doc("x",reference.reference_name)

update_due_amount in has following code

def update_due_amount(self,name_of_doctype):
    frappe.db.sql("""update `tabx` set due_amount = '{0}' where name ='{2}'""".format(due_amount,amount_paid,name_of_doctype))

but when i take the submitted doctype of x it is not updated unitll i refresh the page

so to refresh the page

i wrote this code in x.js

frappe.ui.form.on('Hotel Booking', {
	refresh: function(frm) {
check_difference: function(frm,due_amount){{
			method: "ims.ims.doctype.x.x.get_due_amount",
			args  : {
				"dt" : frm.doc.doctype,
					if(r.message != due_amount)

get_due_amount in has this code

def get_due_amount(dt,dn,due_amount):
	hb = frappe.get_doc("x",dn)
	due_amount = hb.due_amount
	return due_amount

but i would like to know is there any better way to do this with out refreshing the form