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

ERPNext V15 - Error While Rename Item Code #40

Closed
donnieferdian opened this issue Dec 7, 2023 · 5 comments · Fixed by #50
Closed

ERPNext V15 - Error While Rename Item Code #40

donnieferdian opened this issue Dec 7, 2023 · 5 comments · Fixed by #50
Labels
bug Something isn't working

Comments

@donnieferdian
Copy link

donnieferdian commented Dec 7, 2023

Information about bug

Hi Guys, i've got Error while Rename item Code

Screenshot 2023-12-07 at 13 15 33
Screen.Recording.2023-12-07.at.13.12.42.mov
Details

App Versions

{
	"erpnext": "15.5.0",
	"frappe": "15.4.1",
	"hrms": "15.5.0",
	"payments": "0.0.1",
	"print_designer": "1.0.0",
	"webshop": "0.0.1"
}

Route

Form/Item/LOSTVAPE - URSA BABY KIT

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, 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 1715, 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/rename_doc.py", line 75, in update_document_title
    transformed_name = doc.run_method("before_rename", current_name, updated_name, merge)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 950, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1316, in composer
    return composed(self, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1300, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: execute() takes from 3 to 4 positional arguments but 5 were given

Request Data

{
	"type": "POST",
	"args": {
		"doctype": "Item",
		"docname": "LOSTVAPE - URSA BABY KIT",
		"name": "URSA BABY KIT",
		"title": "URSA BABY KIT",
		"enqueue": true,
		"merge": 0,
		"freeze": true,
		"freeze_message": "Updating related fields..."
	},
	"freeze": true,
	"freeze_message": "Updating related fields...",
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.model.rename_doc.update_document_title",
	"request_id": null
}

Response Data

{
	"exception": "TypeError: execute() takes from 3 to 4 positional arguments but 5 were given",
	"exc_type": "TypeError"
}

Module

stock

Version

Erpnext : 15.5.0
Frappe : 15.4.1

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
	"erpnext": "15.5.0",
	"frappe": "15.4.1",
	"hrms": "15.5.0",
	"payments": "0.0.1",
	"print_designer": "1.0.0",
	"webshop": "0.0.1"
}

Route

Form/Item/LOSTVAPE - URSA BABY KIT

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, 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 1715, 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/rename_doc.py", line 75, in update_document_title
    transformed_name = doc.run_method("before_rename", current_name, updated_name, merge)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 950, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1316, in composer
    return composed(self, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1300, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: execute() takes from 3 to 4 positional arguments but 5 were given

Request Data

{
	"type": "POST",
	"args": {
		"doctype": "Item",
		"docname": "LOSTVAPE - URSA BABY KIT",
		"name": "URSA BABY KIT",
		"title": "URSA BABY KIT",
		"enqueue": true,
		"merge": 0,
		"freeze": true,
		"freeze_message": "Updating related fields..."
	},
	"freeze": true,
	"freeze_message": "Updating related fields...",
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.model.rename_doc.update_document_title",
	"request_id": null
}

Response Data

{
	"exception": "TypeError: execute() takes from 3 to 4 positional arguments but 5 were given",
	"exc_type": "TypeError"
}
@donnieferdian donnieferdian added the bug Something isn't working label Dec 7, 2023
@donnieferdian donnieferdian changed the title Error Rename Item Code ERPNext V15 - Error While Rename Item Code Dec 7, 2023
@s-aga-r s-aga-r transferred this issue from frappe/erpnext Dec 8, 2023
@ankush ankush transferred this issue from frappe/frappe Dec 11, 2023
@sagarvora

This comment was marked as outdated.

@donnieferdian
Copy link
Author

Update to the latest version of webshop, the issue has been fixed: fe42033

hi @sagarvora
I have updated to the latest version, and the error notification no longer appears. However, the error message is now displayed in the comments section.

Meanwhile, the product code still cannot be updated. I have attached a video demonstrating the issue.
https://youtu.be/6mcGUFvJL_w
Best regards.

@davygarg
Copy link

davygarg commented Jan 5, 2024

Update to the latest version of webshop, the issue has been fixed: fe42033

hi @sagarvora I have updated to the latest version, and the error notification no longer appears. However, the error message is now displayed in the comments section.

Meanwhile, the product code still cannot be updated. I have attached a video demonstrating the issue. https://youtu.be/6mcGUFvJL_w Best regards.

Hi@sagarvora

I also have same issue.

Traceback (most recent call last):
File "apps/frappe/frappe/model/document.py", line 1631, in execute_action
getattr(doc, __action)(**kwargs)
File "apps/frappe/frappe/model/document.py", line 1035, in _rename
self.name = rename_doc(doc=self, new=name, merge=merge, force=force, validate=validate_rename)
File "apps/frappe/frappe/model/rename_doc.py", line 208, in rename_doc
new_doc.run_method("after_rename", old, new, merge)
File "apps/frappe/frappe/model/document.py", line 953, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1319, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1303, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
TypeError: execute() takes from 1 to 2 positional arguments but 5 were given

Regards

@sagarvora
Copy link
Contributor

will fix soon with PR

@donnieferdian
Copy link
Author

Solve #50
thankyou @sagarvora

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants