fix(accounts): validate company abbreviation before naming

(cherry picked from commit cf4e3a0715)
This commit is contained in:
pandiyan
2026-10-23 13:59:45 +00:00
committed by Mergify
parent a2f8b6cd30
commit a9ea2a54bf
+3
View File
@@ -1441,6 +1441,9 @@ def validate_field_number(doctype_name, docname, number_value, company, field_na
def get_autoname_with_number(number_value, doc_title, company):
"""append title with prefix as number and suffix as company's abbreviation separated by '-'"""
company_abbr = frappe.get_cached_value("Company", company, "abbr")
if not company_abbr:
frappe.throw(_("Company {0} does not exist or has no abbreviation").format(company))
parts = [doc_title.strip(), company_abbr]
if cstr(number_value).strip():