While creating item with opening stock value getting permission error

You are not allowed to access this DocType record because it is linked to Company 'Duplex Solutions' in field Company
User happy@gmail.com does not have access to this document: Stock Entry - None
Insufficient Permission for Stock Entry (create)

here is the error i am getting
but i already given the user permission to stock manager and stock user
item is creating for another company which is related to the user also i have added company field i all doctype related to this.
also if i make an stock entry through stock entry list it is being created with the same user and the company.
anyone know about this

1 Like

Hello @jaassim

The error suggests that the user lacks permission for the company “Duplex Solutions” in the Stock Entry document. Although the user has the Stock Manager and Stock User roles, they may not have specific permissions for the company.

Verify that the user has proper company permissions under “User Permissions” and ensure that the company field is correctly configured in the Stock Entry.

Hello @Smit-Bhaliya
Thanks For your reply,
my user has user permission to another company which means the stock entry has to be done in that company, for that i have setted company field inside stock entry list so that it takes the value to that company.
also this is happening only while creating new item with opening stock value.
after creating item without opening value and if i enter stock entry after creating item its working fine also.
anyways i am sharing my screenshots for this



Pls Create Stock Entry From this user and share proper error screenshot

sure,
here are the screenshots
while creating item with opening stock value



while creating item without opening stock value and saved


creating stock entry




and stock entry is created also

first set the default company whatever you need after that try

1 Like

yes its working after setting the global default.
but here is my question is this global defaults is not for the user?
because if i change here the next company users global default company is changed.
how i can solve this issue?

Please explore the session default, if needed.

1 Like

@NCP Thanks for your reply,
I tried this and this is working fine. But here this default has to set by user manually right? why this default is not set with the user default company which is set by the user permission. Is it possible to make this automatically set session default by the user default company which is set by the admin?

If you set user permissions for a user to access only one company, you need to set it as the default. Once it’s set as the default and the user logs in, the default company will be applied to their session. We tested this, and it works properly.

Even I feel like that but for me its not working i will share the screenshots here

screenshot for setting user default company with user permission.

screenshot after logged in as same user and checked whether session default is set

here the user default company is not set for session even after user permission set for default company. Dropdown is coming for selecting manually

If user permission is set for the company then don’t set the session default because when you open the any transaction then default company automatically set which you set in the user permission. First, you need to understand the concept of user permissions and session defaults.

But As you said that after setting default company and the user logs in, it will set the default company to the session right? even after i set the default company for the user it is not set for the session after the user logs in

Please check it.

@NCP This is already set in my side also. as i can see i am able to enter material request normally, As my issue is while creating item with an opening stock its getting error.
here i am sharing my screen recording with this message.

Screenrecord

Check the all permissions via role permission manager

This also i checked it is also there and assigned roles to the user too. Also I am able to make stock entry by going to stock entry list doctype seperately. But only while creating through item its getting restricted.

If user permission is applied, when creating a new item then please enter the company name in the Item Defaults and warehouse.

That is working so my question is while creating an item the user has to manually select the item default company and warehouse. Also I can see that even after giving restriction for user to company here in item default all company is being listed where it has to list the company which user belongs too.

this list has to show the company which the user has the permission right like the screenshot below

Because “igonre permission” apply on that field, if you remove then user can only watch the one company.