Argument in Custom Script for method with input "self"

Im trying to run a custom script to call a custom method with the following code:

frappe.ui.form.on(‘Sales Order’, ‘other_charges’, function(from){{
				"method": "erpnext.controllers.taxes_and_totals.calc_tot_cont",

				args: { },
				callback:function(r){ cur_frm.set_value("total_contribution",total_contribution);}

My python code is as follows:

def calc_tot_cont(self):
	total_contribution = 0.0
	for item in self.doc.get("items"):
		total_contribution += ((item.base_rate - item.incoming_price) * item.qty)
	total_contribution -= self.doc.other_charges
	return total_contribution

While the script runs, I get an error saying the the method requires 1 argument , but 0 are given. Could somebody help me out with this?
What argument should be given for a method running self?

Thanks a lot!

As you not passing any argument in .
why you write in script, remove - args: { } and try again.

Hi @Sangram,

Thats exactly what i had input. Still got the error.
I found a separate solution to my problem with another script, but would still like to know how to pass the arguments for future reference.


check syntax
e.g. if you have pass customer and name of sales order as argument .

frappe.ui.form.on('Sales Order', 'other_charges', 
			"method": "your_method_path",
			args: { 
				"customer": frm.doc.customer
				//your script