In `search.py` it was hardcoded that **DocType** and **Role** get translated before matching against the search text. This way, a user can type in his local language and still see correct results.
This feature is useful for other DocTypes as well. The criterion would be: there is a small, fairly static number of records, so that the performance impact of translating all names first is not too bad.
This PR adds a hook `translated_search_doctypes` that determines which DocType names get translated before search.
I also added **Country** to `translated_search_doctypes` for frappe. The link to **Country** is frequently used in **Address**, but until now there was no way to use it in the local language. There are ~70% less Countries than DocTypes (including ERPNext), so the performance should be fine.
ERPNext could, for example, add the **Gender** DocType to this hook. As there are very few genders, translating them is fast and improves the UX.
Docs: https://frappeframework.com/docs/v13/user/en/python-api/hooks/edit?wiki_page_patch=b4d7c8d6fc
add .gitkeep file so that public folder is committed to git this is
needed because if public doesn't exist, bench build doesn't
symlink the public folder to sites/assets
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
* Remove six for PY2 compatability since our dependencies are not, PY2
is legacy.
* Removed usages of utils from future/past libraries since they are
deprecated. This includes 'from __future__ ...' and 'from past...'
statements.
* Removed compatibility imports for PY2, switched from six imports to
standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
Changes:
* Renamed hook from `user_privacy_documents` to `user_data_fields`
* Renamed ref field from `match_field` to `filter_by`
* Renamed ref field from `personal_fields` to `redact_fields`
* Removed ref field `applies_to_website_user` from hook options -- let's
treat all requests equally and redact data from all privacy docs
* Added boilerplate hook for new apps
- show all linked doc in a dialog box on cancel event
- following changes only fetch cancelable docs
- recursively build a list of linked submitted docs
- cancel all linked documents before cancelling current document
- add progress bar and group documents by doctype
- added exempted doctype list in hooks
* feat: allow overriding dasboards via hooks
* fix: allow extending dashboard data in hooks
* fix: move logic to generic function
* format: added description to hook