Account Analytics gross profit error

Traceback (most recent call last):
File “/home/zhujieo/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/zhujieo/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/zhujieo/frappe-bench/apps/frappe/frappe/handler.py”, line 42, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/zhujieo/frappe-bench/apps/frappe/frappe/init.py”, line 907, in call
return fn(*args, **newargs)
File “/home/zhujieo/frappe-bench/apps/frappe/frappe/desk/query_report.py”, line 94, in run
res = frappe.get_attr(method_name)(frappe._dict(filters))
File “/home/zhujieo/frappe-bench/apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py”, line 17, in execute
gross_profit_data = GrossProfitGenerator(filters)
File “/home/zhujieo/frappe-bench/apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py”, line 106, in init
self.process()
File “/home/zhujieo/frappe-bench/apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py”, line 129, in process
row.buying_amount = self.get_buying_amount(row, row.item_code)
File “/home/zhujieo/frappe-bench/apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py”, line 214, in get_buying_amount
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
File “/home/zhujieo/frappe-bench/apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py”, line 227, in get_average_buying_rate
average_buying_rate = get_valuation_rate(item_code, row.warehouse, allow_zero_rate=True)
TypeError: get_valuation_rate() takes at least 4 arguments (3 given)

Replicating. Thanks for reporting.

@rohit_w please check.

Hi @Zhujieo

Thanks for reporting the issue, we have fixed the issue and soon we’ll release the fix.

Thanks!:blush:

HI @rohit_w:
The gross profit is ok. Thanks a lot. But the Purchase Invoice Trends is have any problem.
Like is:
Traceback (most recent call last): File "/home/zhujieo/frappe-bench/apps/frappe/frappe/app.py", line 56, in application response = frappe.handler.handle() File "/home/zhujieo/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle execute_cmd(cmd) File "/home/zhujieo/frappe-bench/apps/frappe/frappe/handler.py", line 42, in execute_cmd ret = frappe.call(method, **frappe.form_dict) File "/home/zhujieo/frappe-bench/apps/frappe/frappe/__init__.py", line 907, in call return fn(*args, **newargs) File "/home/zhujieo/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 94, in run res = frappe.get_attr(method_name)(frappe._dict(filters)) File "/home/zhujieo/frappe-bench/apps/erpnext/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py", line 12, in execute data = get_data(filters, conditions) File "/home/zhujieo/frappe-bench/apps/erpnext/erpnext/controllers/trends.py", line 126, in get_data (filters.get("company"), year_start_date, year_end_date), as_list=1) File "/home/zhujieo/frappe-bench/apps/frappe/frappe/database.py", line 138, in sql self._cursor.execute(query, values) File "/home/zhujieo/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute self.errorhandler(self, exc, value) File "/home/zhujieo/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue OperationalError: (1054, "Unknown column 't2.stock_qty' in 'field list'"
)

Hi @Zhujieo

Thanks for reporting an issue, have fixed the issue and soon will release it

Thanks, Rohit