How to custom doctype in Link Cards of core Modules

I need to add new item in Link cards of CRM in Settings Cards.rsz_screenshot_from_2020-07-30_11-26-39

Like we have CRM > Settings > LinkedIn Settings
I want to add new item just below Linkedin Setting

Thanks in advance

1 Like

In your custom app, add crm.py in config folder with the code for your link

from __future__ import unicode_literals
from frappe import _

    def get_data():
    	return [
    		{
    			"label": _("Settings"),
    			"items": [
    				{
    					"type": "doctype",
    					"name": "Your doctype",
    					"label": "the text you want to display",
    				},
                            ]}]

You can only add, not replace.

Tried as you specified, still no result

Here is the screenshot of the same

  • Can you get to the doctype from search box on the navbar?
  • Have you reload the page (from Setting menu on navbar)?
  • Is there any typo?

Yes , I can find the doctype from search box
Yes , I have reload the page and even restarted the bench again and loged in again.
Nope there is no typo

The "type": "doctype", has underline, what is it?

Try to copy the crm.py from erpnext, delete everything except 1 item, change the doctype name to your doctype and see if it showed up.

Its pycharm typo, which give green underline at doctype everywhere in app.

Do we need to update the hooks.py of custom app, so that it can over-write the eprNext crm.py with custom app crm.py

No hooks is needed.
And it will not replace or overwrite, it only add. So if you have:

Settings:

  • Abc
  • Def

then your code (Ghi) will add below the default:

Settings:

  • Abc
  • Def
  • Ghi

Have you tried this?

Yes bro,
I tried as you said. Restarted the bench, and logged in again, still no results.

It seems everything is correct. I don’t know why it doesnt showed up.

Try to copy the whole crm.py from erpnext’s config and put it in your custom app’s config and, if I remember correctly, there will be doubled links in the card.

Yes, I tried that to I copy past whole crm.py to my custom app crm.py and just added one more item(my doctype) like the previous items available in it.
But still no changes every this sill remains same.

May be a bench build or bench migrate can fix it?

I’m sorry I don’t think I can of any further help.

Thanks for the support.
Will update this thread as I find the solution for this.
Thank You

O ya… just fyi.
If the config can’t find the doctype (wrong name, doctype not exist, etc) then the link will also not be shown on the page.

I rechecked everything .
And also preformed bench migrate still no changes appear.
Thanks

been stuck with this issue for like months now. No clear tutorial on how to do this :frowning:

1 Like

Working for me !!

How ? can you tell me i am facing same issue

What is the version-13 way of doing the same?

Sorry I don’t use version-13.
But I guess it is the same?