Skip to content

Frappe Hack: Links using related title, instead of name

License

Notifications You must be signed in to change notification settings

marquelzikri/title_links

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Title Links (ERPNext version 12 support)

Note

I added allowed routes functions so that this Link field formatter only works on desired routes and not breaking other Link fields on some routes. Because somehow this formatter doesn't worked on reference_doctype field at 'Data Export'. You can add your preffered routes at Title Link Fields Formatter Setup doctype.

In some cases, we need hide the standard name of a DocType in favor of another value in the doctype, and get it simple to the end user.

Title Links, do exactly it, it replace the value displayed in the Links and Dynamic Links fields, to the value of the title field, defined in your DocTypes.

When the title is not present, we will ensure the same behavior of the original widgets of frappe, displaying the name.

That is how the normal behavior of Link Widget looks like:

schermata 2017-02-08 alle 13 31 23

This is how the related record looks like in frappe

schermata 2017-02-08 alle 12 49 27

Frappe, already replace the title value in the visualization area of the Form, and show the original name, in the right side of the form, as a small text. Why we can't do the same to the links?

To me it's by designe is not enought, so I decided to hack frappe.

After install this app, and configure the DocTypes that you need to change to title, like the below image,

schermata 2017-02-08 alle 12 34 19

Your links will look like

schermata 2017-02-08 alle 17 00 56

A selected value will look like

schermata-2017-02-08-alle-18 46 33

Don't worry with Link Formatters, title links already define it to you!

schermata-2017-02-08-alle-18 31 28

License

MIT

About

Frappe Hack: Links using related title, instead of name

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 56.1%
  • Python 37.6%
  • HTML 6.3%