Try ERPNext Buy Support Partners Foundation

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

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.