print args and send the screen shot …
Pls tell me Your doctype name sales agency?
Tree view format must you create those fields doctype_name and parent_doctype,
Your doctype name like sales agency so you ll create sales_agency_name and parent_sales_agency
you called frappe method so this method try to set add child defaults fields but you dont have correct field name then only shown this error pls crt filed name
my doctype name helpdesk category so i created above fields and attached screenshot for your reference if you face again this error pls let me know
It still giving the same error
Pls send doctype screenshot…
sorry it was working it needs cache clear but another hurdle came…
- what’s I supposed to do here is: "When “Group_Node” is ticked on the dialogue, it will create the entry with “Is_grouped” checked but no ‘Parent’ set, (so it will be parked under the root)…
- When “Group_Node” is not ticked, then it will create the entry with “is_group” unchecked but parent set tot he current parent (Folder Name)
but its giving error on both when i check group_node tick and when it is unchecked… especially on parent node
“Could not find Parent Mobile Sales Team: Mobile Sales Team”
this is the error
Step:1 Here All helpdesk category Group node not ticked becoz this is root and parent not set
Step:2 i)select all helpdesk category root and click add child
ii)Enter the new entry and Group node is ticked then click on create new button
iii)to open you created new entry it’s automatically set parent name as ‘root name’ via import nestedset file (here breakdown req is new entry and this parent name is all helpdesk category)
iv)Select new entry and click on add child to create new entry but group node not tick this is a child entry and then click create new button. To open now created new entry parent name set as step (ii).(here engineering utilities is child entry and parent name is breakdown request).
Step:3 when Group node is ticked automatically parent name set as root name for all.
Step:4 It’s all happened you have field must parent_doctype(my field name parent_helpedesk_category i.e helpdesk category is doctype name) and you must assigned in py file like nsm_parent_field = “parent_helpdesk_category”
I have already assigned parent_doctype field and also in py file and also inherited NestedSet class but still it happening… In this screenshot i have click to add child and when i fill these values with group_node ticked and also not ticked, it prompt error
“Could not find Parent Mobile Sales Team: Mobile Sales Team”
You facing could not find parent error then how it’s created sales and mobile sales parent entries …this error show only click create new button ,attach the console error
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 60, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 61, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1042, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/crm/doctype/mobile_sales_team/mobile_sales_team.py”, line 27, in add_node
frappe.get_doc(args).insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 223, in insert
self._validate_links()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 756, in _validate_links
frappe.LinkValidationError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 364, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 350, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 316, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.LinkValidationError: Could not find Parent Mobile Sales Team: Mobile Sales Team
pls tell me what you try in add_node method i think this is the pblm
bench/apps/erpnext/erpnext/crm/doctype/mobile_sales_team/mobile_sales_team.py”, line 27, in add_node
frappe.get_doc(args).insert()
Comment the above line and try again show the same error?
Nothing happened and it didn’t insert that entry…
this is the method:
@frappe.whitelist()
def add_node():
from frappe.desk.treeview import make_tree_args
args = frappe.form_dict
args = make_tree_args(**args)
frappe.get_doc(args).insert()
Parent_doctype is link field is rgt? what you give in option?
yes it is link field and i have given the same doctype… like my doctype is Mobile Sales Team and i have given the Mobile Sales Team in options… rgt is Int field
That worked for me …see the link you are missing anything
This is the error logs, how can see here which thing i miss ??
When I try to add a child node into another child, it give me error
“Item cannot be added to its own descendents”…
I just couldn’t understand how to overwrite this error which is coming from nestedSet.py class because we have inherited nestedSet class
why you try to add child node to another child node ? child node have own parent directly you can add. This error shown one entry to add own(child node name have another child name)
Pls explain how to you add child node to another child node?