fix: General Ledger translation issues (#27298)

* fix: remove translations from GL report options

Options need not be translated, their display label gets translated
client side.

* fix: make group by options translatable

* ci: semgrep rule for translated options in report

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
Dany Robert
2021-09-08 16:28:05 +05:30
committed by GitHub
parent df3e4ce1c0
commit fa819f2fb0
3 changed files with 43 additions and 13 deletions

View File

@@ -19,3 +19,16 @@ rules:
languages: [python]
severity: ERROR
- id: frappe-translated-values-in-business-logic
paths:
include:
- "**/report"
patterns:
- pattern-inside: |
{..., filters: [...], ...}
- pattern: |
{..., options: [..., __("..."), ...], ...}
message: |
Using translated values in options field will require you to translate the values while comparing in business logic. Instead of passing translated labels provide objects that contain both label and value. e.g. { label: __("Option value"), value: "Option value"}
languages: [javascript]
severity: ERROR