From 77e57870363c3e1b45b8e2fc428b940cb6aaa72b Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Sat, 17 Aug 2024 01:57:44 +0200 Subject: [PATCH] fix: use pseudo-translation while creating fixtures --- .../setup/setup_wizard/operations/install_fixtures.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py index 1d2530cfdf0..ba5d0772ceb 100644 --- a/erpnext/setup/setup_wizard/operations/install_fixtures.py +++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py @@ -7,7 +7,6 @@ import os from pathlib import Path import frappe -from frappe import _ from frappe.desk.doctype.global_search_settings.global_search_settings import ( update_global_search_doctypes, ) @@ -18,6 +17,14 @@ from erpnext.accounts.doctype.account.account import RootNotEditable from erpnext.regional.address_template.setup import set_up_address_templates +def _(x, *args, **kwargs): + """Redefine the translation function to return the string as is. + + We want to create english records but still mark the strings as translatable. + The respective DocTypes have 'Translate Link Fields' enabled.""" + return x + + def read_lines(filename: str) -> list[str]: """Return a list of lines from a file in the data directory.""" return (Path(__file__).parent.parent / "data" / filename).read_text().splitlines()