No description
Find a file
Himanshu 70409a3c7b
fix: set translated text to link field (#15451)
- 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
2022-05-16 13:21:42 +00:00
.github docs: Removed whitespace from Try on FC button 2022-04-28 14:52:29 +05:30
cypress fix: set translated text to link field (#15451) 2022-05-16 13:21:42 +00:00
esbuild chore: set esbuild output target to es2017 2022-04-01 21:30:42 +05:30
frappe fix: set translated text to link field (#15451) 2022-05-16 13:21:42 +00:00
.editorconfig chore: extend editorconfig to vue components 2021-08-25 20:12:55 +05:30
.eslintignore fix: Miscellaneous changes (#12343) 2021-02-08 12:05:37 +05:30
.eslintrc chore: eslint - use es2020 for parsing 2022-04-18 15:06:23 +05:30
.flake8 ci: fix semgrep false positives (#13161) 2021-05-12 20:22:48 +05:30
.git-blame-ignore-revs chore: Ignore codebase formatting change in blame 2022-04-12 11:30:28 +05:30
.gitignore chore: VS2022 uses .vs instead of .vscode. Add .vs to .gitignore. 2021-12-13 11:16:11 +11:00
.mergify.yml ci(Mergify): configuration update (#16655) 2022-04-18 17:34:44 +05:30
.pre-commit-config.yaml style: format all python files using black (#16453) 2022-04-12 10:59:25 +05:30
.pylintrc reactor(scheduler): created "Scheduler Job Type" and cleaned up scheduler 2019-11-07 12:14:09 +05:30
.releaserc chore: do not publish any assets 2022-04-18 16:45:39 +05:30
.snyk [Snyk] Fix for 1 vulnerabilities (#11523) 2020-09-17 10:00:48 +05:30
.stylelintrc fix: Miscellaneous changes (#12343) 2021-02-08 12:05:37 +05:30
attributions.md Non Pour Accent! (#5427) 2018-04-10 22:53:42 -08:00
bandit.yml fix(tests): tests and linting 2019-02-13 16:50:34 +05:30
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2017-09-12 09:14:34 +05:30
codecov.yml refactor: Clean up whitespace & add CI check 2022-02-25 20:01:29 +05:30
CODEOWNERS chore: Update CODEOWNERS 2022-04-01 15:00:57 +05:30
cypress.json chore: colocate ui tests 2022-01-03 16:19:11 +05:30
dev-requirements.txt chore: Clean up requirements 2021-11-11 20:56:47 +05:30
generate_bootstrap_theme.js fix: Common sass_options 2021-04-27 11:24:19 +05:30
hooks.md chore!: remove dead hooks app_icon & app_color 2022-05-10 14:41:01 +05:30
LICENSE chore: Update copyright until date to 2021 2021-09-03 12:19:15 +05:30
Makefile [NEW] Makefile to clean cache without restart 2018-03-08 15:18:32 +05:30
node_utils.js fix: set correct default redis async broker in node_utils 2021-05-21 16:09:43 +05:30
package.json chore: bump plyr to latest version 2022-05-12 16:30:30 +05:30
pyproject.toml style: format all python files using black (#16453) 2022-04-12 10:59:25 +05:30
README.md style(README): Fixed inconsistent whitespaces 2022-04-28 14:52:42 +05:30
requirements.txt Merge pull request #15538 from noahjacob/phone_field_control 2022-04-28 10:27:52 +05:30
SECURITY.md chore: updated Security policy and issue template 2019-10-12 12:06:36 +05:30
setup.py style: format all python files using black (#16453) 2022-04-12 10:59:25 +05:30
sider.yml chore(sider): add sider default config for flake8 + ignore tab errors (W191) (#12587) 2021-03-16 17:07:41 +05:30
socketio.js fix: publish realtime to work with localhost (backport #14174) (#14196) 2021-09-14 12:09:01 +05:30
yarn.lock chore: bump plyr to latest version 2022-05-12 16:30:30 +05:30


a web framework with "batteries included"

it's pronounced - fra-pay

Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for ERPNext

Login for the PWD site: (username: Administrator, password: admin)

Table of Contents

Installation

Contributing

  1. Code of Conduct
  2. Contribution Guidelines
  3. Security Policy
  4. Translations

Resources

  1. frappeframework.com - Official documentation of the Frappe Framework.
  2. frappe.school - Pick from the various courses by the maintainers or from the community.

License

This repository has been released under the MIT License.