Rename of a company creates issues

Hello everyone,

In ERPNEXT, I have created a company called “Paradox Paris” and I have started to create sales invoices, purchase orders, etc. Everything works fine.

I have decided to rename this company “Paradox Europe”. For this, I went to the company list, selected the company, then I clicked on its name at the top of the screen and I was able to change the name. Now, when I try to create a sales invoice, I get an error message which quickly disappears and then when I want to save it, the debtor account is empty, it is like the whole chart of account is inaccessible. I also experienced a few things here and there, which make me think that the old name has not been replaced in all the database tables.

I am using the latest version of ERPNEXT, 9.1.4 and 9.1.6 for frappe.

Could someone please confirm that he experiences the same behavior. If yes, I will be happy to create a bug in github.

Enjoy your day,
w

I document here what I have done to fix the issue. Beware, this means to directly modify the database and therefore you have to be extra-careful. Also, I give no guarantee that this method is correct nor that it won’t create any side effect in the future.

I dumped the entire database into a file in order to find all the occurrences of “Paradox Paris” (the OLD company name): mysqldump mydatabasename -uroot -pmyrootpassword > ~/output2.sql

I ignored the occurrences from the tables “__global-search”, “help”, “tabVersion”.

I found that the content of the table “tabCost Center” stills had a reference to “Paradox Paris”, so I deleted the two records in this table and inserted the modified records (there should be inverted quotes around the table name but they are considered as formatting marks):

INSERT INTO tabCost Center VALUES (‘Main - P’,‘2017-09-06 23:29:21.332033’,‘2017-09-06 23:29:21.366482’,‘Administrator’,‘Administrator’,0,NULL,NULL,NULL,9,NULL,3,‘Main’,NULL,‘Paradox Europe’,NULL,0,‘Paradox Europe - P’,2,‘Paradox Europe - P’,NULL),
(‘Paradox Europe - P’,‘2017-09-06 23:29:20.863218’,‘2017-09-06 23:29:21.354717’,‘Administrator’,‘Administrator’,0,NULL,NULL,NULL,0,NULL,4,‘Paradox Europe’,NULL,‘Paradox Europe’,NULL,1,’’,1,NULL,NULL);

I also found another reference to the old company in the table “tabEmail Digest” (there should be inverted quotes around the table name but they are considered as formatting marks):

INSERT INTO tabEmail Digest VALUES (‘Default Weekly Digest - Paradox Europe’,‘2017-09-06 23:29:54.635499’,‘2017-09-06 23:29:54.635499’,‘Administrator’,‘Administrator’,0,NULL,NULL,NULL,0,1,1,NULL,‘Weekly’,1,1,1,1,1,NULL,1,1,1,‘Paradox Europe’,1,‘myemail@gmail.com’,1,1,1,1,NULL,NULL,1,NULL,1,1,1,1,1),(‘Scheduler Errors’,‘2017-09-06 23:29:54.708164’,‘2017-09-06 23:29:54.708164’,‘Administrator’,‘Administrator’,0,NULL,NULL,NULL,0,0,1,NULL,‘Daily’,0,0,0,0,0,NULL,0,0,0,‘Paradox Europe’,0,‘myemail@gmail.com’,0,0,0,0,NULL,NULL,0,NULL,0,0,0,0,0);

1 Like

Company is linked in many doctypes. Hope you found them all.

But, easier and recommend solution is, when viewing the company, click on Menu at the top right, and then click “Rename”. This would fix all links as well. This is the recommended way to “rename” a doctype.

My preference would actually be to remove the ability to click on a title to rename because it misleads people into thinking that’s the only step needed…

2 Likes

I agree with you, it should not be possible to rename a company if it is incomplete and it creates issues.