fix: partial rename while replacing abbreviation (#27065)

This commit is contained in:
Saqib 2021-08-25 18:26:00 +05:30 committed by GitHub
parent 81b4590479
commit 60675379c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -423,11 +423,11 @@ def replace_abbr(company, old, new):
_rename_record(d)
try:
frappe.db.auto_commit_on_many_writes = 1
frappe.db.set_value("Company", company, "abbr", new)
for dt in ["Warehouse", "Account", "Cost Center", "Department",
"Sales Taxes and Charges Template", "Purchase Taxes and Charges Template"]:
_rename_records(dt)
frappe.db.commit()
frappe.db.set_value("Company", company, "abbr", new)
except Exception:
frappe.log_error(title=_('Abbreviation Rename Error'))