Relevant log output / Stack trace / Full Error Message.
bench run-tests --doctype "Budget" --test test_monthly_budget_crossed_ignore
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
main()
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
click.Group(commands=commands)(prog_name="bench")
File "/home/aarti/postgres/frappe-bench-postgres/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/env/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/aarti/postgres/frappe-bench-postgres/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/aarti/postgres/frappe-bench-postgres/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/aarti/postgres/frappe-bench-postgres/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/aarti/postgres/frappe-bench-postgres/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/env/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/commands/__init__.py", line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/commands/utils.py", line 790, in run_tests
ret = frappe.test_runner.main(
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/test_runner.py", line 88, in main
ret = run_tests_for_doctype(
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/test_runner.py", line 214, in run_tests_for_doctype
return _run_unittest(
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/test_runner.py", line 283, in _run_unittest
out = runner.run(test_suite)
File "/usr/lib/python3.10/unittest/runner.py", line 184, in run
test(result)
File "/usr/lib/python3.10/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.10/unittest/suite.py", line 122, in run
test(result)
File "/usr/lib/python3.10/unittest/case.py", line 650, in __call__
return self.run(*args, **kwds)
File "/usr/lib/python3.10/unittest/case.py", line 591, in run
self._callTestMethod(testMethod)
File "/usr/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
method()
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/test_budget.py", line 23, in test_monthly_budget_crossed_ignore
jv = make_journal_entry(
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/journal_entry/test_journal_entry.py", line 563, in make_journal_entry
jv.submit()
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 178, in submit
return self._submit()
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 1031, in _submit
return self.save()
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 337, in save
return self._save(*args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 390, in _save
self.run_post_save_methods()
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 1131, in run_post_save_methods
self.run_method("on_submit")
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 962, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 1322, in composer
return composed(self, method, *args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 1304, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 959, in fn
return method_object(*args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 190, in on_submit
self.make_gl_entries()
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 1109, in make_gl_entries
make_gl_entries(
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/general_ledger.py", line 47, in make_gl_entries
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/general_ledger.py", line 386, in save_entries
make_entry(entry, adv_adj, update_outstanding, from_repost)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/general_ledger.py", line 400, in make_entry
validate_expense_against_budget(args)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/budget.py", line 221, in validate_expense_against_budget
validate_budget_records(args, budget_records, expense_amount)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/budget.py", line 232, in validate_budget_records
compare_expense_with_budget(
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/budget.py", line 261, in compare_expense_with_budget
args.requested_amount, args.ordered_amount = get_requested_amount(args), get_ordered_amount(args)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/budget.py", line 400, in get_requested_amount
data = frappe.db.sql(
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/database/postgres/database.py", line 218, in sql
return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/database/database.py", line 249, in sql
traceback.print_stack()
'Error in query:\ncolumn "child.rate" must appear in the GROUP BY clause or be used in an aggregate function\nLINE 1: ...lesce((sum(child.stock_qty - child.ordered_qty) * rate), 0) ...\n ^\n'
E
======================================================================
ERROR: test_monthly_budget_crossed_ignore (erpnext.accounts.doctype.budget.test_budget.TestBudget)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/test_budget.py", line 23, in test_monthly_budget_crossed_ignore
jv = make_journal_entry(
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/journal_entry/test_journal_entry.py", line 563, in make_journal_entry
jv.submit()
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 178, in submit
return self._submit()
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 1031, in _submit
return self.save()
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 337, in save
return self._save(*args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 390, in _save
self.run_post_save_methods()
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 1131, in run_post_save_methods
self.run_method("on_submit")
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 962, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 1322, in composer
return composed(self, method, *args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 1304, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/model/document.py", line 959, in fn
return method_object(*args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 190, in on_submit
self.make_gl_entries()
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 1109, in make_gl_entries
make_gl_entries(
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/general_ledger.py", line 47, in make_gl_entries
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/general_ledger.py", line 386, in save_entries
make_entry(entry, adv_adj, update_outstanding, from_repost)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/general_ledger.py", line 400, in make_entry
validate_expense_against_budget(args)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/budget.py", line 221, in validate_expense_against_budget
validate_budget_records(args, budget_records, expense_amount)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/budget.py", line 232, in validate_budget_records
compare_expense_with_budget(
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/budget.py", line 261, in compare_expense_with_budget
args.requested_amount, args.ordered_amount = get_requested_amount(args), get_ordered_amount(args)
File "/home/aarti/postgres/frappe-bench-postgres/apps/erpnext/erpnext/accounts/doctype/budget/budget.py", line 400, in get_requested_amount
data = frappe.db.sql(
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/database/postgres/database.py", line 218, in sql
return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
File "/home/aarti/postgres/frappe-bench-postgres/apps/frappe/frappe/database/database.py", line 227, in sql
self._cursor.execute(query, values)
psycopg2.errors.GroupingError: column "child.rate" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...lesce((sum(child.stock_qty - child.ordered_qty) * rate), 0) ...
^
----------------------------------------------------------------------
Ran 1 test in 0.613s
FAILED (errors=1)
Information about bug
ERROR: test_monthly_budget_crossed_ignore (erpnext.accounts.doctype.budget.test_budget.TestBudget)
Module
accounts
Version
Frappe - v15 Erpnext- v15
Installation method
None
Relevant log output / Stack trace / Full Error Message.