Custom made Doctype not showing

Hi there i have a issue im fighting with. I created a custom Doctype, however it does not appear when i go to Setup>Email account>Account i set up>Append To. Any help ?
My email settings and domain is correct because if i Append to Issue and send a email, then i get tickets in issue.

are you able to search this doctype in the Search bar of your ERPNext ?

Yes i can, only problem is i cant Append to in email account.
Where do you go to add it there?

What exactly does this doctype do or what purpose does it serve ?

You will have to add in the Module’s python file setup.py it is available in folder called config. See the examples and you can do the same for yours too

Its basically a Customized Issue. I duplicated it then renamed and added my own fields because i needed the standard and the customized Issue Doctypes/Forms for different email account.

Where is that module file?

This is what i get in Error Log:

{‘retry’: 0, ‘log’: <function log at 0x7f6687ec41b8>, ‘site’: u’site1.local’, ‘event’: u’all’, ‘method_name’: u’pull_from_email_account’, ‘method’: <function pull_from_email_account at 0x7f66873bc050>, ‘user’: u’Administrator’, ‘kwargs’: {‘email_account’: u’CoCT Issues Support’}, ‘async’: True, ‘job_name’: u’pull_from_email_account|CoCT Issues Support’}
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 97, in execute_job
method(**kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 704, in pull_from_email_account
email_account.receive()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 298, in receive
raise Exception(frappe.as_json(exceptions))
Exception: [
“Traceback (most recent call last):\n File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 275, in receive\n communication = self.insert_communication(msg, args=args)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 374, in insert_communication\n self.set_thread(communication, email)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 419, in set_thread\n self.set_sender_field_and_subject_field()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 440, in set_sender_field_and_subject_field\n meta_module = frappe.get_meta_module(self.append_to)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 659, in get_meta_module\n return frappe.modules.load_doctype_module(doctype)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 187, in load_doctype_module\n raise ImportError(‘Module import failed for {0} ({1})’.format(doctype, module_name + ’ Error: ’ + str(e)))\nImportError: Module import failed for CoCT Issue (erpnext.support.doctype.coct_issue.coct_issue Error: No module named coct_issue.coct_issue)\n”
]

Oh then you could have inserted the fields via the Customize Form route, you can also save these as fixtures. No need for a seperate doctype or duplicating it.

I have 2 emails. One handles normal issues right, then this custom issue has its own email and fields. If i go the customize route how do i separate the 2 from showing each others fields?

Do both have a different purpose ? You can make your fields visible when a certain purpose is selected or set. Check out Depends On - it will evaluate conditions you set and those fields will be visible only if condition satisfied.

Depends on->works fine. Now my problem is getting the email address in.
If i can have a field that stores the email link then im sorted.
I can do it in javascript but how do i get the email address the client is sending to?
Because with that i can use Depends on.
Any Ideas on the code?

Any yes Both serves a different purpose

can you share screenshots

Okay so i found a fix.
What i did was:

  1. Enter developer mode by going to site/site/site_config.json, all you add is a line [“developer_mode”: 1,] then you save.
  2. Next clear the cache by using [bench clear-cache] command.
  3. Added my doctype or modified by removing tick of “custom” then saved it.
  4. Added my doctype in the hooks.py file and it worked.
6 Likes

also, it could be user admin issue, which was in my case. You need to do following

bench --site XYZ set-admin-password admin

and login with user- administrator and password-admin