mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
Merge pull request #42803 from barredterra/pseudo-translate-in-setup-wizard
This commit is contained in:
@@ -48,7 +48,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-27 13:10:05.597711",
|
"modified": "2024-08-16 19:22:42.942264",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Mode of Payment",
|
"name": "Mode of Payment",
|
||||||
@@ -74,5 +74,6 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"states": []
|
"states": [],
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-27 13:10:04.846687",
|
"modified": "2024-08-16 19:24:55.811760",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "CRM",
|
"module": "CRM",
|
||||||
"name": "Market Segment",
|
"name": "Market Segment",
|
||||||
@@ -40,5 +40,6 @@
|
|||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": [],
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1,
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
"icon": "icon-flag",
|
"icon": "icon-flag",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-27 13:05:57.956050",
|
"modified": "2024-08-16 19:22:57.706521",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Projects",
|
"module": "Projects",
|
||||||
"name": "Activity Type",
|
"name": "Activity Type",
|
||||||
@@ -84,5 +84,6 @@
|
|||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"states": []
|
"states": [],
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-27 13:10:21.571554",
|
"modified": "2024-08-16 19:24:29.480229",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Projects",
|
"module": "Projects",
|
||||||
"name": "Project Type",
|
"name": "Project Type",
|
||||||
@@ -70,5 +70,6 @@
|
|||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": [],
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1,
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_tree": 1,
|
"is_tree": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-27 13:06:48.550415",
|
"modified": "2024-08-16 19:21:41.880111",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Customer Group",
|
"name": "Customer Group",
|
||||||
@@ -212,5 +212,6 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": []
|
"states": [],
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -17,9 +17,7 @@ class CustomerGroup(NestedSet):
|
|||||||
from frappe.types import DF
|
from frappe.types import DF
|
||||||
|
|
||||||
from erpnext.accounts.doctype.party_account.party_account import PartyAccount
|
from erpnext.accounts.doctype.party_account.party_account import PartyAccount
|
||||||
from erpnext.selling.doctype.customer_credit_limit.customer_credit_limit import (
|
from erpnext.selling.doctype.customer_credit_limit.customer_credit_limit import CustomerCreditLimit
|
||||||
CustomerCreditLimit,
|
|
||||||
)
|
|
||||||
|
|
||||||
accounts: DF.Table[PartyAccount]
|
accounts: DF.Table[PartyAccount]
|
||||||
credit_limits: DF.Table[CustomerCreditLimit]
|
credit_limits: DF.Table[CustomerCreditLimit]
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
"is_tree": 1,
|
"is_tree": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"max_attachments": 3,
|
"max_attachments": 3,
|
||||||
"modified": "2024-03-27 13:09:54.588785",
|
"modified": "2024-08-16 19:20:36.401913",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Item Group",
|
"name": "Item Group",
|
||||||
@@ -206,5 +206,6 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": []
|
"states": [],
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_tree": 1,
|
"is_tree": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-27 13:10:48.734325",
|
"modified": "2024-08-16 19:22:02.022181",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Supplier Group",
|
"name": "Supplier Group",
|
||||||
@@ -170,5 +170,6 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"states": []
|
"states": [],
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_tree": 1,
|
"is_tree": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-27 13:10:53.240951",
|
"modified": "2024-08-16 19:21:19.161490",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Territory",
|
"name": "Territory",
|
||||||
@@ -188,5 +188,6 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": []
|
"states": [],
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,6 @@ import os
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
|
||||||
from frappe.desk.doctype.global_search_settings.global_search_settings import (
|
from frappe.desk.doctype.global_search_settings.global_search_settings import (
|
||||||
update_global_search_doctypes,
|
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
|
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]:
|
def read_lines(filename: str) -> list[str]:
|
||||||
"""Return a list of lines from a file in the data directory."""
|
"""Return a list of lines from a file in the data directory."""
|
||||||
return (Path(__file__).parent.parent / "data" / filename).read_text().splitlines()
|
return (Path(__file__).parent.parent / "data" / filename).read_text().splitlines()
|
||||||
@@ -68,49 +75,49 @@ def install(country=None):
|
|||||||
# Stock Entry Type
|
# Stock Entry Type
|
||||||
{
|
{
|
||||||
"doctype": "Stock Entry Type",
|
"doctype": "Stock Entry Type",
|
||||||
"name": "Material Issue",
|
"name": _("Material Issue"),
|
||||||
"purpose": "Material Issue",
|
"purpose": "Material Issue",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "Stock Entry Type",
|
"doctype": "Stock Entry Type",
|
||||||
"name": "Material Receipt",
|
"name": _("Material Receipt"),
|
||||||
"purpose": "Material Receipt",
|
"purpose": "Material Receipt",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "Stock Entry Type",
|
"doctype": "Stock Entry Type",
|
||||||
"name": "Material Transfer",
|
"name": _("Material Transfer"),
|
||||||
"purpose": "Material Transfer",
|
"purpose": "Material Transfer",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "Stock Entry Type",
|
"doctype": "Stock Entry Type",
|
||||||
"name": "Manufacture",
|
"name": _("Manufacture"),
|
||||||
"purpose": "Manufacture",
|
"purpose": "Manufacture",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "Stock Entry Type",
|
"doctype": "Stock Entry Type",
|
||||||
"name": "Repack",
|
"name": _("Repack"),
|
||||||
"purpose": "Repack",
|
"purpose": "Repack",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "Stock Entry Type",
|
"doctype": "Stock Entry Type",
|
||||||
"name": "Send to Subcontractor",
|
"name": _("Send to Subcontractor"),
|
||||||
"purpose": "Send to Subcontractor",
|
"purpose": "Send to Subcontractor",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "Stock Entry Type",
|
"doctype": "Stock Entry Type",
|
||||||
"name": "Material Transfer for Manufacture",
|
"name": _("Material Transfer for Manufacture"),
|
||||||
"purpose": "Material Transfer for Manufacture",
|
"purpose": "Material Transfer for Manufacture",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "Stock Entry Type",
|
"doctype": "Stock Entry Type",
|
||||||
"name": "Material Consumption for Manufacture",
|
"name": _("Material Consumption for Manufacture"),
|
||||||
"purpose": "Material Consumption for Manufacture",
|
"purpose": "Material Consumption for Manufacture",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
@@ -274,9 +281,9 @@ def install(country=None):
|
|||||||
{"doctype": "Opportunity Type", "name": _("Sales")},
|
{"doctype": "Opportunity Type", "name": _("Sales")},
|
||||||
{"doctype": "Opportunity Type", "name": _("Support")},
|
{"doctype": "Opportunity Type", "name": _("Support")},
|
||||||
{"doctype": "Opportunity Type", "name": _("Maintenance")},
|
{"doctype": "Opportunity Type", "name": _("Maintenance")},
|
||||||
{"doctype": "Project Type", "project_type": "Internal"},
|
{"doctype": "Project Type", "project_type": _("Internal")},
|
||||||
{"doctype": "Project Type", "project_type": "External"},
|
{"doctype": "Project Type", "project_type": _("External")},
|
||||||
{"doctype": "Project Type", "project_type": "Other"},
|
{"doctype": "Project Type", "project_type": _("Other")},
|
||||||
{"doctype": "Print Heading", "print_heading": _("Credit Note")},
|
{"doctype": "Print Heading", "print_heading": _("Credit Note")},
|
||||||
{"doctype": "Print Heading", "print_heading": _("Debit Note")},
|
{"doctype": "Print Heading", "print_heading": _("Debit Note")},
|
||||||
# Share Management
|
# Share Management
|
||||||
@@ -370,8 +377,8 @@ def add_uom_data():
|
|||||||
).read()
|
).read()
|
||||||
)
|
)
|
||||||
for d in uom_conversions:
|
for d in uom_conversions:
|
||||||
if not frappe.db.exists("UOM Category", _(d.get("category"))):
|
if not frappe.db.exists("UOM Category", d.get("category")):
|
||||||
frappe.get_doc({"doctype": "UOM Category", "category_name": _(d.get("category"))}).db_insert()
|
frappe.get_doc({"doctype": "UOM Category", "category_name": d.get("category")}).db_insert()
|
||||||
|
|
||||||
if not frappe.db.exists(
|
if not frappe.db.exists(
|
||||||
"UOM Conversion Factor",
|
"UOM Conversion Factor",
|
||||||
@@ -380,7 +387,7 @@ def add_uom_data():
|
|||||||
frappe.get_doc(
|
frappe.get_doc(
|
||||||
{
|
{
|
||||||
"doctype": "UOM Conversion Factor",
|
"doctype": "UOM Conversion Factor",
|
||||||
"category": _(d.get("category")),
|
"category": d.get("category"),
|
||||||
"from_uom": d.get("from_uom"),
|
"from_uom": d.get("from_uom"),
|
||||||
"to_uom": d.get("to_uom"),
|
"to_uom": d.get("to_uom"),
|
||||||
"value": d.get("value"),
|
"value": d.get("value"),
|
||||||
@@ -494,7 +501,6 @@ def update_stock_settings():
|
|||||||
stock_settings.item_naming_by = "Item Code"
|
stock_settings.item_naming_by = "Item Code"
|
||||||
stock_settings.valuation_method = "FIFO"
|
stock_settings.valuation_method = "FIFO"
|
||||||
stock_settings.default_warehouse = frappe.db.get_value("Warehouse", {"warehouse_name": _("Stores")})
|
stock_settings.default_warehouse = frappe.db.get_value("Warehouse", {"warehouse_name": _("Stores")})
|
||||||
stock_settings.stock_uom = _("Nos")
|
|
||||||
stock_settings.stock_uom = "Nos"
|
stock_settings.stock_uom = "Nos"
|
||||||
stock_settings.auto_indent = 1
|
stock_settings.auto_indent = 1
|
||||||
stock_settings.auto_insert_price_list_rate_if_missing = 1
|
stock_settings.auto_insert_price_list_rate_if_missing = 1
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"modified": "2024-03-27 13:10:17.226079",
|
"modified": "2024-08-16 19:41:19.591111",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Price List",
|
"name": "Price List",
|
||||||
@@ -130,5 +130,6 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"states": []
|
"states": [],
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-08-20 15:35:45.696958",
|
"modified": "2024-08-22 16:00:22.696958",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Stock Entry Type",
|
"name": "Stock Entry Type",
|
||||||
@@ -88,5 +88,6 @@
|
|||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"states": [],
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1,
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-27 13:09:53.126034",
|
"modified": "2024-08-16 19:23:40.697426",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Support",
|
"module": "Support",
|
||||||
"name": "Issue Priority",
|
"name": "Issue Priority",
|
||||||
@@ -38,5 +38,6 @@
|
|||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"states": [],
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1,
|
||||||
|
"translated_doctype": 1
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user