Cannot save a document for a custom doctype

Ive tried to make a custom doctype but im getting this error when i try to save a new document of that type

Traceback (most recent call last): File “/home/oliver/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application response = frappe.api.handle() File “/home/oliver/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle return frappe.handler.handle() File “/home/oliver/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle data = execute_cmd(cmd) File “/home/oliver/frappe-bench/apps/frappe/frappe/handler.py”, line 61, in execute_cmd return frappe.call(method, **frappe.form_dict) File “/home/oliver/frappe-bench/apps/frappe/frappe/init.py”, line 1054, in call return fn(*args, **newargs) TypeError: savedocs() missing 2 required positional arguments: ‘doc’ and ‘action’

Home

Status: 500

what is happening here

@Oliver_Faulkner I’m running into the same issue. Did you ever resolve this?

Pointers like this may help How to extend core code using custom app

This isn’t a custom function. This error is coming from attempting to create a new DocType from within the GUI as directed here: Not Found

The form seems to be sending a post request with “doc” and “action” parameters to /api/method/frappe.desk.form.save.savedocs but the function doesn’t seem to be getting them.

Screenshot from chrome DevTools:
2020-04-02--131335

So example code that creates a DocType via the api would point the way here…

edit:

The code you have referenced seems to be about creating new items of a doctype that already exists. I really can’t see how creating a new item record will help me create a new table. Maybe there’s a miscommunication, let me try explaining further.

I’m working on a shipping label app. I’m trying to create a new “shipment” doctype. The documentation says to go to Developer > Documents > DocType > New to create this. The form in that location fails and gives an error stating that the “doc” and “action” parameters are missing from the post request. The post request shows that it did in fact send those parameters.

I feel like i might be missing a step, but I can’t find anything on it.

I resolved this. My module was not setup correctly. Following the details in the post below with a new app allowed me to get through the error.

1 Like

Ah yes, you wished to define a new DocType, not create a new instance of an existing one…