I created a Script report which is showing the cash flow statement. When I am running this on local machine without any data its working fine, although when I try to run this with similar case in staging and prod its giving me an error: TypeError: unsupported operand type(s) for +=: ‘float’ and ‘NoneType’.
I am also unable reproduce this error in my local. I even tried disabling developer mode to see if the error comes now in local, although I am unable to do that.
logs for the issue are following:
Trackeback
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 69, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 45, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1609, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/__init__.py", line 789, in wrapper_fn
retval = fn(*args, **get_newargs(fn, kwargs))
File "apps/frappe/frappe/desk/query_report.py", line 251, in run
result = generate_report_result(report, filters, user, custom_columns, is_tree, parent_field)
File "apps/frappe/frappe/__init__.py", line 789, in wrapper_fn
retval = fn(*args, **get_newargs(fn, kwargs))
File "apps/frappe/frappe/desk/query_report.py", line 87, in generate_report_result
res = get_report_result(report, filters) or []
File "apps/frappe/frappe/desk/query_report.py", line 68, in get_report_result
res = report.execute_script_report(filters)
File "apps/frappe/frappe/core/doctype/report/report.py", line 142, in execute_script_report
res = self.execute_module(filters)
File "apps/frappe/frappe/core/doctype/report/report.py", line 159, in execute_module
return frappe.get_attr(method_name)(frappe._dict(filters))
File "apps/cyb_hrms/cyb_hrms/cyb_hrms/report/cash_flow_statement/cash_flow_statement.py", line 189, in execute
File "apps/cyb_hrms/cyb_hrms/cyb_hrms/report/cash_flow_statement/cash_flow_statement.py", line 29, in get_net_cash_increase_for_period
# else:
TypeError: unsupported operand type(s) for +=: 'float' and 'NoneType'