erpnext
erpnext copied to clipboard
Gross Profit >> Groupby "Payment Terms" is throwing an error
Information about bug
- Visit the Gross Profile report
- From the filters, select "Payment Terms" in the group_by field
- It is throwing an error - "TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'"
Module
accounts
Version
ERPNext: v14.0.0-dev (HEAD) Frappe Framework: v14.0.0-dev (HEAD)
Installation method
FrappeCloud
Relevant log output / Stack trace / Full Error Message.
request.js:438 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 1579, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/__init__.py", line 780, in wrapper_fn
retval = fn(*args, **get_newargs(fn, kwargs))
File "apps/frappe/frappe/desk/query_report.py", line 253, in run
result = generate_report_result(report, filters, user, custom_columns, is_tree, parent_field)
File "apps/frappe/frappe/__init__.py", line 780, 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/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py", line 18, in execute
gross_profit_data = GrossProfitGenerator(filters)
File "apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py", line 408, in __init__
self.process()
File "apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py", line 477, in process
self.get_average_rate_based_on_group_by()
File "apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py", line 504, in get_average_rate_based_on_group_by
invoice_portion = row.payment_amount * 100 / row.base_net_amount
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

Works fine, could not replicate