Frappe Hack: Links using related title, instead of name

@max_morais_dmm Hi there, and sorry to keep bothering you.

Seems there are some issue on the title_link app. On PO, in the child Item table it displays the Item Code, see pic:

while opening the row it works properly:

it could be a V7 issue? If possible, can u please have a look at that?

Thanks a lot

@JoEz, I dont tested it in v7 due I’m working in a stable version!

@JoEz, report an issue in my app repository, I’ll work on this soon! I’ll turn it a manageable option, with a settings doctype, to you choice which doctypes should use the title in links and wich should not.

@max_morais_dmm …added issues to ur project. Thx for help

Can someone help me to get rid of this issue please? I have installed both of @max_morais_dmm and @Pau_Rosello 's app with erpnext. But I have ended up with many errors. I wrote a custom query from which I fetched autocomplete lists of child table’s values of a specific group of items. When I select another field except name(from my returned query) it replaced with a null value. I think this issue needs to be solved into the erpnext so that we can select any other field rather than name of a doctype in the child field. Thanks in advance.

Title Links from @max_morais_dmm with ERPNext v12 support: Title Links

3 Likes

Thanks a lot :slight_smile: @zikrimarquel

Getting this error when tried to to install the app on frappe V13.
Is it required to try and setup on V12?

$ ./env/bin/pip install -q -U -e ./apps/title_links
ERROR: Command errored out with exit status 1:
command: /Users/atulkuruvilla/Documents/Code/frappe-dev/frappe-bench/env/bin/python3.8 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/Users/atulkuruvilla/Documents/Code/frappe-dev/frappe-bench/apps/title_links/setup.py’“'”‘; file=’“'”‘/Users/atulkuruvilla/Documents/Code/frappe-dev/frappe-bench/apps/title_links/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ egg_info --egg-base /private/var/folders/hg/fr1tjds53zl84cttt7c8l9_c0000gn/T/pip-pip-egg-info-2r9s5z9x
cwd: /Users/atulkuruvilla/Documents/Code/frappe-dev/frappe-bench/apps/title_links/
Complete output (7 lines):
Traceback (most recent call last):
File “”, line 1, in
File “/Users/atulkuruvilla/Documents/Code/frappe-dev/frappe-bench/apps/title_links/setup.py”, line 22, in
install_requires=[str(ir.req) for ir in requirements],
File “/Users/atulkuruvilla/Documents/Code/frappe-dev/frappe-bench/apps/title_links/setup.py”, line 22, in
install_requires=[str(ir.req) for ir in requirements],
AttributeError: ‘ParsedRequirement’ object has no attribute ‘req’
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

@pythonpen this project doesn’t work anymore and dont will be maintened

Few weeks after the release of that project, frappé framework had one release that deprecated the library that was mading this project possible.

Now, it’s almost impossible change the behavior of links using the way that project was using.

So, because of this and other reasons, I dont will continue supporting this app.

2 Likes

Is this implemented in ERPNext core?

No, it’s not implemented into the core

Ok, got your point - but I like to look at the pattern that you have used to build feature that can override core functionality without making changes to the core.

Do you have any other working examples that I can refer to achieve core customisations via app?

@pythonpen part of mine solution rely on link formatters, that If I’m not wrong, doesn’t have support anymore in ERPNext since the version-12

I usually look how things works in frappe and ERPNext to abstract how extend the core trought custom apps

I do have 2 github accounts https://github.com/mxmo-co and MaxMorais (Maxwell Morais) · GitHub there you will find few customizations

1 Like

Hi @zikrimarquel,
I have tried to install Title Links version with ERPNext v12 support from your repo, but got following error. Has anybody successfuly installed it on ERPNext: v12.13.0 (version-12)/Frappe Framework:v12.11.0 (version-12) ?

Installing title_links
$ ./env/bin/pip install -q -U -e ./apps/title_links  
   ERROR: Command errored out with exit status 1:
    command: /home/martin/frappe-bench/env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '
"'"'/home/martin/frappe-bench/apps/title_links/setup.py'"'"'; __file__='"'"'/home/martin/frappe-bench/apps/t
itle_links/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n
'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-p
ip-egg-info-tk1z4wzb                                                                                         
        cwd: /home/martin/frappe-bench/apps/title_links/                                                    
   Complete output (7 lines):                                                                               
   Traceback (most recent call last):                                                                       
     File "<string>", line 1, in <module>                                                                   
     File "/home/martin/frappe-bench/apps/title_links/setup.py", line 22, in <module>                       
       install_requires=[str(ir.req) for ir in requirements],                                               
     File "/home/martin/frappe-bench/apps/title_links/setup.py", line 22, in <listcomp>                     
       install_requires=[str(ir.req) for ir in requirements],                                               
   AttributeError: 'ParsedRequirement' object has no attribute 'req'                                        
   ----------------------------------------                                                                 
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I suppose this error is related to setup.py format, I have tried to replace it with setup.py from another working app, then I was able to install it, but app is not working - links are still displayed as a links.

I have made some tests and found this. Maybe it will be useful for someone. Please correct me, if I’m wrong.

Older version of Title Links by @max_morais_dmm feat. @JoEz
Automatically displays Titles instead of Links in all Doctypes. You get “John Doe” instead of “CUST-0001” after selecting it from dropdown.
After update of setup.py and solving Python3 compatibility issues looks like working OK with ERPNext v12.13.0. It gives this error in console, probably because referenced
frappe.views.ListRenderer no more exists in version 12. I can’t tell, if it is a real issue, looks like it is working anyway.

Uncaught TypeError: Cannot read property 'extend' of undefined
    at title_links.js:438 (frappe.views.ListRenderer = frappe.views.ListRenderer.extend)
    at title_links.js:477

Updated version of Title Links by @zikrimarquel
Uses different approach - you have to set up Doctype in what you want to display Links as a Titles.
After update of setup.py looks like working OK with ERPNext v12.13.0 with one issue - there is one more page reload after displaying of the Doctype, which is set up to display Link as a Title. Reload is indicated by message “Please wait - Page reloading”, what shortly flashes on black screen background, what is a little distracting. You can get rid of that message by commenting it in code, but reload is probably needed to render Title.

Hi @martin42 - have you been able to get this to work? If so, could you point me to to corrected repo?

This feature seems trivial but I think it is significant in UI/UX.
I really hope this feature included in the core.

Update - got it working.

I had to change 2 lines on setup.py.

I forked this from GitHub - techmaxsolucoes/title_links: Frappe Hack: Links using related title, instead of name

Still does not work on links in a child table. I modified the doctype ‘doctype’ and removed a filter ‘eval:!doc.istable’ from the newly added “Title Field” and “Search Field”

Any ideas on how to take this further would be nice.

1 Like