ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Renaming company abbreviation is broken: How to fix Cost Center names?

We are running ERPnext in a multicompany setup. As we open new daughter companies, we realized that we need to rename the abbreviations of old companies.

ERPnext has the (IMHO unpleasant) characteristic to automatically append the company abbreviation to several other doctype names such as CoA or Cost Centers. This abbreviation is however not editable and only appended automatically by the system.

Changing the company abbreviation propagates correctly and adjusts the name in the Chart of Accounts, but the abbreviations in the Cost Centers remain the old ones. Manually renaming the Cost Centers also doesn’t work for me.

Did anyone experience a similar issue or can you also reproduce it? How can I fix it? The old companies are renamed but the Cost Centers can’t be renamed to match the new abbreviations.

(Github issue is raised here: https://github.com/frappe/erpnext/issues/26746)

See if setting the parent cost center first and then child allows you to do fix it.

Thanks for the advice. Unfortunately, that’s not the solution. Renaming the Cost Center won’t change the abbreviation. The abbreviation appended to the name of the Cost Center is set automatically by ERPnext and can not be changed manually.
A fix I found was to delete the old Cost Center and create new ones. But this also doesn’t work entirely, as the Parent Cost Center (with the old abbreviation) can’t be deleted.

As mentioned in the Github issue, this problem seems to have deeper roots: Some of the warehouses and tax templates are also affected and remain with the old abbreviation.

I am currently on the latest version (13.7). There were recently two changes to the renaming
in 13.7 (https://github.com/frappe/erpnext/pull/26462) and in 13.6 (https://github.com/frappe/erpnext/pull/26203). If I understand it correctly, with the recent PRs renaming can be just aborted because “If a company has 20k+ warehouses or accounts, then replacing the abbreviation is never completed and throws error while being executed in a background job” (see https://github.com/frappe/erpnext/pull/26142).
It seems to be an unclean solution to the problem that the fix is just to stop renaming (not sure if this is really what is done - just my brief understanding of the PRs).

@nextchamp.saqib I think you created the PRs. Is it possible that these PRs are the root of the issue? How can we circumvent the problem of a potentially very long list of entries (warehouse, CC etc) that need to be renamed while still making sure that all entries are renamed properly?

I still can’t figure out the use of abbreviation. Why it is there and how it is used by ERPNext? Anyone with deeper knowledge here?

I don’t really have deeper knowledge why it was added in the first place. It seems to me a historic relic that no one has bothered to change yet (as it’s mostly cosmetic). I think in a multi-company setup it can be useful to differentiate between different entries if they otherwise had the same name. However in my opinion, one should be free to adjust the entire name and just add it the way it is wished/must appropriate (with our without abbreviation, in front/back of the name, different separator etc.) would be also interested to learn more about its background.