zaviagodev / frappe

MIT License
0 stars 1 forks source link

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' Possible source of error: Server Script /app/customer #143

Closed chomchuen closed 8 months ago

chomchuen commented 8 months ago

What's happen?

customer that crated though sales invoice modal have this error. https://apps.hosting.zaviago.com/app/customer/chomchom1

Image

customer created from here:

Image


App Versions

{
    "apps_maintainer": "0.0.1",
    "business_automations": "0.0.1",
    "erpnext": "15.6.1",
    "frappe": "15.5.0",
    "test_app": "0.0.1"
}

Route

Form/Customer/chomchom1

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, 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 49, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 71, in execute_cmd
    return run_server_script(server_script)
  File "apps/frappe/frappe/handler.py", line 89, in run_server_script
    response = frappe.get_doc("Server Script", server_script).execute_method()
  File "apps/frappe/frappe/core/doctype/server_script/server_script.py", line 150, in execute_method
    return execute_api_server_script(self)
  File "apps/frappe/frappe/core/doctype/server_script/server_script.py", line 286, in execute_api_server_script
    _globals, _locals = safe_exec(script.script, script_filename=script.name)
  File "apps/frappe/frappe/utils/safe_exec.py", line 101, in safe_exec
    exec(
  File "<serverscript>: customer_total_spending", line 27, in <module>
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Request Data

{
    "type": "POST",
    "args": {
        "reference": "chomchom1"
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/customerSpending",
    "request_id": null
}

Response Data

{
    "exception": "TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'",
    "exc_type": "TypeError",
    "_exc_source": "Server Script"
}
chomchuen commented 8 months ago

--RESOVLED✅--

Image