I am using the ERPNext Shipping module, and after creating a Delivery Note, I want to link the order with a shipping service. I am able to create a Shipment Order successfully, but I encounter an error when trying to Print the Shipping Label.
Has anyone faced this issue before? Any guidance on how to resolve it would be appreciated.
ERROR
Server Error
UnboundLocalError: cannot access local variable ‘shipping_label’ where it is not associated with a value
Possible source of error: erpnext_shipping (app)
Furthermore, here is the detail of this error:
App Versions
{
"erpnext": "15.52.0",
"erpnext_shipping": "15.0.3",
"frappe": "15.56.1",
}
Route
Form/Shipment/SHIPMENT-00002
Traceback
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 114, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/__init__.py", line 49, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/handler.py", line 50, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/__init__.py", line 1726, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "apps/erpnext_shipping/erpnext_shipping/erpnext_shipping/shipping.py", line 197, in print_shipping_label
return shipping_label
^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'shipping_label' where it is not associated with a value
Request Data
{
"type": "POST",
"args": {
"shipment": "SHIPMENT-00002"
},
"freeze": true,
"freeze_message": "Printing Shipping Label",
"headers": {},
"error_handlers": {},
"url": "/api/method/erpnext_shipping.erpnext_shipping.shipping.print_shipping_label",
"request_id": null
}
Response Data
{
"exception": "UnboundLocalError: cannot access local variable 'shipping_label' where it is not associated with a value",
"exc_type": "UnboundLocalError",
"_exc_source": "erpnext_shipping (app)"
}