If user, for some reason, will clear the warehouse name from imput field; warehouse is not anymore showed in the link field, only Advanced Search appear, see pic:
I faced similar situation, I wanted to restrict users to certain warehouses.
It works well for limiting access to PR or any DocType based on warehouse. When Warehouse are restricted only PRs with allowed warehouses are shown to user.
It is not limiting warehouses in link field. For this I used a workaround. Added Custom Link Field for Territory under Warehouse Doctype and set user restrictions for territories as well. This solved the problem for me.
So now Users are allowed to see those Warehouses for whose Territories are allowed.
I created a new group node for Warehouse Territories under Territory tree.
@revant_one thanks for the hint, what PR stands for?
Btw it would not work for us …we’ve 8 warehouse (stores) in the same city …so we need to limit access per user per warehouse.
It looks like a bug on the way links are working …i mean, link is limited correctly when the page is loaded (on load) …while when u delete the content of the search doesn’t show anymore the warehouse …
An workaround could be to have Warehouse field read only depending on user role …is that possible?
Honestly i’d prefer to have the link working as it’s supposed to be …
thx to explain but i still think it’s a bug on the way link works …i shouldn’t need to add custom fields on warehouse to make it working …should work once role is set …and it works for on load document …
Cash Ward is a custom doctype; applying same user permission as warehouse doctype …it works perfectly …it sound to me like a bug in the way warehouse link are displayed
Hi @JoEz
I was stuck with the same problem. Your solution helped me too!.
Although the only intended change I could see is where a list view is supposed to fetch warehouse names. Here only the warehouse permitted to the user is visible. This is off-course intended.
Further, I noticed that even if the access to a particular warehouse is restricted, the user is still able to see Material requests for other warehouses. What is strange is that the user can also make stock entries for material requests of a warehouse not permitted to the user.
Since “Source Warehouse”, “For Warehouse”, “Target Warehouse” are linked fields in all of the items the user should basically not be able to see any of these requests. I have made sure that the “Ignore User Permissions” check box in unchecked the Material Request and Material Request Item DocType.
Material Request did not have a linked field to warehouse. The linked field was in its child table Material Request Item. So I customized the form to add a hidden field of link type- pointing to the warehouse.
This way I could add the user permission “If Warehouse is permitted” to the Material Request DocType.