mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-20 03:47:11 +00:00
fix: do not translate default record lookup keys
Company.create_default_departments named and looked up the root
Department via _("All Departments"), which resolves in the session
language. A site set up in a non-English language stores the root
translated, and a company created later from a session in another
language misses it and inserts a second root, corrupting the tree.
Resolve the root once with get_root_of (falling back to the canonical
English name on fresh installs) and reuse it for the root record, the
exists-guard and the child departments' parent.
Also stop translating lookups of records install_fixtures stores under
English names: Price List "Standard Selling" and Print Headings
"Credit Note" / "Debit Note".
Same class as the root Item Group fix (#57386, issue #57345).
This commit is contained in:
@@ -459,11 +459,11 @@ def make_return_doc(doctype: str, source_name: str, target_doc=None, return_agai
|
||||
|
||||
# look for Print Heading "Credit Note"
|
||||
if not doc.select_print_heading:
|
||||
doc.select_print_heading = frappe.get_cached_value("Print Heading", _("Credit Note"))
|
||||
doc.select_print_heading = frappe.get_cached_value("Print Heading", "Credit Note")
|
||||
|
||||
elif doctype == "Purchase Invoice":
|
||||
# look for Print Heading "Debit Note"
|
||||
doc.select_print_heading = frappe.get_cached_value("Print Heading", _("Debit Note"))
|
||||
doc.select_print_heading = frappe.get_cached_value("Print Heading", "Debit Note")
|
||||
elif doctype == "Delivery Note":
|
||||
# manual additions to the return should hit the return warehous, too
|
||||
doc.set_warehouse = default_warehouse_for_sales_return
|
||||
|
||||
Reference in New Issue
Block a user