Cannot Access Company After Attempting to Recreate Potential Issue

In an earlier post I explained an issue I was having in ERPNext Cloud.

To sum up the relevant parts for this post, suppose I have created Company0 and Company1. Whenever a new Sales Order was created (or any other document that had the Company field), the chosen company was not the same as that of the Global Defaults. The company listed as the default was Company1.

@rmehta pointed out in my earlier post that “it must be a configuration issue” and so I kept looking around for a solution.

I then noticed that for my user, which was the one created using the setup wizard, there was a user permission which had Company for Allow and Company0 in For Value. I deleted this permission and after that the problem pointed out above was resolved.

I thought there was something odd, however, because when my user had that user permission, I was still able to created records for Company1, and it is my understanding that my user should have only been allowed to view/create records for Company0 and not Company1.

I attempted to recreate this problem to try to identify what was going on and so I again set a user permission for my user to allow Company0. Things went back to how they were before and I was still able to view/create records for both companies.

I then deleted this user permission and set a new user permission to allow my user for Company1 only. With this permission, I was only able to view/create records for Company1 and not for Company0. I then deleted this user permission (so at this point my user has nothing listed under user permissions) and then I noticed that I was not able to access anything regarding Company0 nor Company1.

I tried to solve this by creating a new user permission where I hoped to set the value for one of the companies but (not surprisingly) no company shows up when I tried to assign it to my user.

I’m not sure if this is relevant but Company0 is the one that I created using the setup wizard and Company1 was created by creating a new company by a system user.

Any suggestions?

Hi jayfiro

Maybe set your instance to a ‘standard permissions’ state would help?

But with a cloud instance, have you console access to ‘bench reset-permissions’?

good luck to you

Hi @clarkej, no access to bench reset-permissions :frowning:

I managed to get access to Company1 again.

Since wee had a sales user with permission for Company1, we then assigned all roles to this user and through this user created a user permission for my user to be allowed for Company1.

Just one more company to go now :smiley: