Issue trying to call whitelisted PY function in Custom App not working in production

Calling whitlisted python function only works in my local installation but not in production. custom app name is ilis and module name is ilis.

here is the error screenshot


frappe.ui.form.on('Export', {
	refresh: function(frm) {
		cur_frm.add_custom_button(__('Cargo Tracking'), function(){
					method: "ilis.ilis.doctype.export.export.make_cargo_tracking",
					frm: cur_frm
		}, __('Create'));
		cur_frm.add_custom_button(__('Container Entry'), function(){
					method: "ilis.ilis.doctype.export.export.make_container_entry",
					frm: cur_frm
		}, __('Create'));

here is the python file

from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.model.document import Document

class Export(Document):

def make_cargo_tracking(source_name, target_doc=None, ignore_permissions=False):

	doclist = get_mapped_doc("Export", source_name, {
			"Export": {
				"doctype": "Cargo Tracking",
				"field_map": {
					"name": "export_reference",
					"booking_no": "booking_number",
					"bl_number": "bl_number",
					"exporter": "exporter",
					"reference_number": "reference_number",
					"consignee": "consignee",
					"shipping_line": "shipping_line",
					"vessel_name": "vessel_name",
					"discharge_port": "discharge_port",
				"validation": {
					"docstatus": ["=", 0]
		}, target_doc, ignore_permissions=ignore_permissions)

	return doclist

i just can’t figure out why it works on my local setup but not in production.

The code looks fine to me. You said it works in dev environment, so that makes sense.

There has to be something different between your two environments. Are you sure that production has all of the files from the latest branch??

@James_Houx Thanks for the reply, i have been checking to see if there are files missing in production but i’ll continue double checking to see if I’ve missed something.

Have you done “bench restart” first at production?

Yes i have

check the error log and report here, hopefully you should get clue there

@s_Mafutta I found that code changes sometimes do not take effect unless you delete the pycache folder in the export directory. Try this and see if there will be any difference

@flexy2ky tried this it did not work, thanks for the input