Closed blewsky closed 2 years ago
It seems this problem is bigger than previously thought. The company abbreviations are also not correctly propagated to the Tax Templates and Warehouses. The weird thing is, that some Warehouses etc. are renamed correctly and others not. It seems this "feature" (= renaming a company abbreviation) should be overhauled and checked for bugs. A company can potentially have many Accounts, Warehouses, Tax templates etc. that can be affected by the renaming of the company abbreviation. Not having proper names after a change in the abbreviation, can create confusion or other bugs. Therefore, I think this is a serious issue that should be fixed.
Personally, I think it is not a good practice to add the company abbreviation automatically to all these dependent fields for two reasons:
Related discussion in the forum: https://discuss.erpnext.com/t/renaming-company-abbreviation-is-broken-how-to-fix-cost-center-names/78628
The problem probably stems from the functions `enqueue_replace_abbr()' or 'replace_abbr()' in the Company doctype. It seems that two recent changes to the code in V13.7 (https://github.com/frappe/erpnext/pull/26462) and V13.6 (https://github.com/frappe/erpnext/pull/26203) are responsible for this behavior.
@nextchamp-saqib : Can you comment on this from the perspective of the two recent PRs?
Any updates on this? Would be great to get feedback from @nextchamp-saqib ? Otherwise, it could make sense to revert the changes made in https://github.com/frappe/erpnext/pull/26462 and https://github.com/frappe/erpnext/pull/26203 as it seems that they weren't thoroughly tested enough to be rolled out.
@blewsky Sorry for the late response. There seem to be various issues with this feature and I will try to refactor it to address the problems.
However, I can confirm that the problem didn't arise after the 2 recent PRs.
Hi @nextchamp-saqib, any updates on this issue? Could you track where this bug originates from?
Closing this in line with linked PR ^
This feature is very dangerous on large datasets and doesn't have any real blocking use cases.
The problem still persists even with the @nextchamp-saqib 's PR. The abbreviation is added automatically after the cost center. ERPnext still adds the old abbreviation it must have still stored somewhere.
Description of the issue
Changing the abbreviation for a Company, changes the abbreviations appended in the Chart of Accounts but not to Cost Centers.
Steps to reproduce the issue
Abbr.
Field in Company Doctype. This is the pop-up:Observed result
Cost Center
are not changed according to the change inCompany
doctype.Expected result
Changes to the abbreviation in
Company
doctype should directly propagate correctly and affect the abbreviation used in the name of allCost Center
entries.Additional information
ERPNext: v13.7.0 (HEAD) Frappe Framework: v13.7.0 (HEAD)