Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While creation of Packing Slip as we select delivery note showing error #179

Closed
rushabhmaywade opened this issue Oct 4, 2024 · 1 comment · Fixed by #187
Closed

While creation of Packing Slip as we select delivery note showing error #179

rushabhmaywade opened this issue Oct 4, 2024 · 1 comment · Fixed by #187
Assignees
Labels
bug Something isn't working Packing Slip

Comments

@rushabhmaywade
Copy link
Collaborator

Information about bug

image

Module

stock

Version

ERPNext: v15.34.0 (pre-prod)

Frappe Framework: v15.41.0 (pre-prod)

Installation method

None

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
	"erpnext": "15.34.0",
	"frappe": "15.41.0",
	"payments": "0.0.1"
}

Route

Form/Packing Slip/new-packing-slip-rfapdnrsgy

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 114, 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 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1775, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/frappe/frappe/model/mapper.py", line 53, in map_docs
    target_doc = method(*_args)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.py", line 1141, in make_packing_slip
    doclist = get_mapped_doc(
  File "apps/frappe/frappe/model/mapper.py", line 155, in get_mapped_doc
    postprocess(source_doc, target_doc)
  File "apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.py", line 1136, in set_missing_values
    target.run_method("set_missing_values")
  File "apps/frappe/frappe/model/document.py", line 962, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1322, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1304, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 959, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/stock/doctype/packing_slip/packing_slip.py", line 159, in set_missing_values
    self.from_case_no = self.get_recommended_case_no()
  File "apps/erpnext/erpnext/stock/doctype/packing_slip/packing_slip.py", line 177, in get_recommended_case_no
    frappe.db.get_value(
  File "apps/frappe/frappe/database/database.py", line 512, in get_value
    result = self.get_values(
  File "apps/frappe/frappe/database/database.py", line 616, in get_values
    out = self._get_values_from_table(
  File "apps/frappe/frappe/database/database.py", line 889, in _get_values_from_table
    return query.run(as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck)
  File "apps/frappe/frappe/query_builder/utils.py", line 87, in execute_query
    result = frappe.db.sql(query, params, *args, **kwargs)  # nosemgrep
  File "apps/frappe/frappe/database/postgres/database.py", line 218, in sql
    return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
  File "apps/frappe/frappe/database/database.py", line 227, in sql
    self._cursor.execute(query, values)
psycopg2.errors.GroupingError: column "tabPacking Slip.modified" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...'MAT-DN-2024-00001' AND "docstatus"= '1' ORDER BY "modified"...
                                                             ^


Request Data

{
	"type": "POST",
	"args": {
		"method": "erpnext.stock.doctype.delivery_note.delivery_note.make_packing_slip",
		"source_names": "[\"MAT-DN-2024-00001\"]",
		"target_doc": "{\"docstatus\":0,\"doctype\":\"Packing Slip\",\"name\":\"new-packing-slip-rfapdnrsgy\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"Administrator\",\"naming_series\":\"MAT-PAC-.YYYY.-\",\"items\":null,\"letter_head\":\"8848 Digital\",\"delivery_note\":\"MAT-DN-2024-00001\"}"
	},
	"freeze": true,
	"freeze_message": "Mapping {0} ...",
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.model.mapper.map_docs",
	"request_id": null
}

Response Data

{
	"exception": "",
	"exc_type": "GroupingError",
	"_exc_source": "erpnext (app)",
	"_debug_messages": "[\"Error in query:\\ncolumn \\\"tabPacking Slip.modified\\\" must appear in the GROUP BY clause or be used in an aggregate function\\nLINE 1: ...'MAT-DN-2024-00001' AND \\\"docstatus\\\"= '1' ORDER BY \\\"modified\\\"...\\n                                                             ^\\n\"]"
}
@aasif-patel
Copy link
Collaborator

resolved hence closing...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Packing Slip
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants