erpnext
erpnext copied to clipboard
Opportunity Source dependency in Opportunity not localized
Problem
https://github.com/frappe/erpnext/blob/8c7373dfd0775b56006813560d81de2955742ed0/erpnext/crm/doctype/opportunity/opportunity.json#L1286
The depends_on entry of the field campaign in Opportunity is hardcoded to "Campaign".
Reproduce
- Set up your system in German (or any language except English).
- Create a new opportunity and set source to "Kampagne" (or whatever campaign translates to in your language)
=> The Link field for the campaign DocType will not show up.

Cause
By default there is no Opportunity Source "Campaign" because it was correctly translated to the system language ("Kampagne" in the case of German).
Solution
Localize default value, or, if possible, or remove it.
Tested with:
ERPNext: v10.1.64 (master) Frappe Framework: v10.1.56 (master)
(Still present in develop branch as of 2018-11-15)
Related: https://github.com/frappe/erpnext/issues/23432
Seems that any value declared as default isn't translated. This may require a fix on the framework level.
https://github.com/frappe/frappe/pull/17591