refactor: drop translation marking from default warehouse names

warehouse_name is a Data field shown as stored, and everywhere else
users see the docname, which carries the company abbr ("Stores - F")
and is never translated - a translated bare "Stores" has no display
use, so the identity _ marking from #57392 serves nothing. The
exists-guard keeps the runtime session-translation match that protects
legacy sites from duplicate English warehouses.
This commit is contained in:
Mihir Kandoi
2026-07-23 16:45:57 +05:30
parent 5fa242ec93
commit 2ea63ce709

View File

@@ -448,23 +448,18 @@ class Company(NestedSet):
frappe.clear_cache()
def create_default_warehouses(self):
from erpnext.setup.utils import identity as _
parent_warehouse = None
for wh_detail in [
{"warehouse_name": _("All Warehouses"), "is_group": 1},
{"warehouse_name": _("Stores"), "is_group": 0},
{"warehouse_name": _("Work In Progress"), "is_group": 0},
{"warehouse_name": _("Finished Goods"), "is_group": 0},
{"warehouse_name": _("Goods In Transit"), "is_group": 0, "warehouse_type": "Transit"},
{"warehouse_name": "All Warehouses", "is_group": 1},
{"warehouse_name": "Stores", "is_group": 0},
{"warehouse_name": "Work In Progress", "is_group": 0},
{"warehouse_name": "Finished Goods", "is_group": 0},
{"warehouse_name": "Goods In Transit", "is_group": 0, "warehouse_type": "Transit"},
]:
if frappe.db.exists(
"Warehouse",
{
"warehouse_name": (
"in",
(wh_detail["warehouse_name"], frappe._(wh_detail["warehouse_name"])),
),
"warehouse_name": ("in", (wh_detail["warehouse_name"], _(wh_detail["warehouse_name"]))),
"company": self.name,
},
):