Error while send additional parameter to open_mapped_doc

While using frappe.model.open_mapped_doc() it just takes only object with two parameters :

				method: ,
				frm: ,

I am trying to add a third parameter but python always throw an error

missing 1 required positional

Here is my code in Java Script file

function fun(frm){
	let selected = frm.get_selected()
		method: 'my_func_path_in_python_file',
		frm: frm,
		my_third_paramter: selected

Here is my code in Python File

def my_fun(source_name,my_third_paramter):
	def update_item(source, target, source_parent):
		target.field = selected_row

	doclist = get_mapped_doc("Customer",source_name, {
		"Customer": {
			"doctype": "Maintenance Work Order",
			"field_map": {
		},"postprocess": update_item
	return doclist

So Any Help Please !!!

Did you find the solution for this??

@AlinYellow @ibalajib

You should use function like this.

JS Side

			method: "path to your method,
			frm: frm,
			args: {
				doctype: 'Customer',

Py side

def function_name(source_name, target_doc=None):
	doctype = frappe.flags.args.doctype
	customer = frappe.flags.args.customer

Try this solution


Thank you so much! @Hardik_Gadesha

This saved me a lot of time. :))

@ibalajib it will be good if you can mark it as solution, it will save others time too

1 Like

FYI @Hardik_Gadesha , Iā€™m not the one who raised a question so I could not mark this answer as a solution.