- Fixes [Issue/15324](https://github.com/frappe/frappe/issues/15324) - When selecting a value for Link Field, the English text was set as link field value. - This PR aims to fix it by setting the translated text as link field value on selection. Todo: - [x] Show translated text in the select dropdown - [x] Set translated value to Link field on select - [x] Show original value when link field is in focus - [x] Add option to toggle this behaviour ### Behaviour - Link field loses focus: show the translated name. - Link field is focused - If old value is present - If options **are** one of [Role, DocType]: show the translated name - Else: show the name (untranslated) to enable search in untranslated values - Else: show what the user typed (untranslated) to enable search in untranslated values - Value is selected: link field loses focus ## Demo ### Link to UOM in a custom Item DocType The UOM names are in english, so the search needs to happen in english. When possible, the translation is displayed. #### Before https://user-images.githubusercontent.com/14891507/156415248-e5e80d05-53dc-4ca8-89c7-998986ff6e99.mov #### After https://user-images.githubusercontent.com/14891507/156410386-a874430c-f340-43ed-9c3a-92e8d4d50fc9.mov ### Link to DocType in Customize Form The DocType names get translated before being searched. This is a preexisting hack in the framework for DocType and Role. In this case, we can search in the translations. #### Before https://user-images.githubusercontent.com/14891507/156414648-8e505f8c-9dee-4358-8182-3b358c28bb62.mov #### After https://user-images.githubusercontent.com/14891507/156411881-c4ca22e1-1397-4e13-9768-5e16b72f8d6d.mov https://docs.erpnext.com/docs/v13/user/manual/en/customize-erpnext/customize-form/edit?wiki_page_patch=fdafee2715 |
||
|---|---|---|
| .. | ||
| mariadb | ||
| postgres | ||
| __init__.py | ||
| database.py | ||
| db_manager.py | ||
| query.py | ||
| schema.py | ||
| sequence.py | ||