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
export.js
frappe.ui.form.on('Export', {
refresh: function(frm) {
cur_frm.add_custom_button(__('Cargo Tracking'), function(){
frappe.model.open_mapped_doc({
method: "ilis.ilis.doctype.export.export.make_cargo_tracking",
frm: cur_frm
})
}, __('Create'));
cur_frm.add_custom_button(__('Container Entry'), function(){
frappe.model.open_mapped_doc({
method: "ilis.ilis.doctype.export.export.make_container_entry",
frm: cur_frm
})
}, __('Create'));
},
here is the python file export.py
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):
pass
@frappe.whitelist()
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.