Pinned fields
Click on the next to a field label to start pinning.
Details
Details
Assignee
Unassigned
UnassignedReporter
Brandon Bowersox-Johnson
Brandon Bowersox-JohnsonLabels
Components
Affects versions
Priority
Time Assistant
Time Assistant
Created December 12, 2017 at 8:58 PM
Updated February 9, 2023 at 11:10 AM
Steps to Reproduce
To see this problem, we need a user who has no home facility but still has Stock Manager role at a Supervisory Node. Here are steps to set that up for 'vsrmanager1' from demo data:
Log in as 'administrator' / password
Navigate to Administration > Users
Filter for username 'vsrmanager1' and click Search
Click Roles button for vsrmanager1
Under Supervision tab, add a role: Program=EPI, Supervisory Node="Cuamba district approval point (EPI) (Deposito Distrital Cuamba)", Role=Stock Manager. Click Add Role. (Screenshot attached.)
Click Save User Roles.
Log off from administrator.
Now here are steps to reproduce:
Log in as 'vsrmanager1' / password
Navigate to Stock Management > Stock on Hand. This section works fine. User can view stock cards for any facility in District Cuamba (eg "Cuamba, Cuamba" which has demo data stock cards for many products in EPI program).
Navigate to Stock Management > Adjustments.
ERROR: "Internal application error" "Please check console logs for more information." The Javascript console has a stack trace:
handleStateChangeError @ openlmis.js:70 $broadcast @ openlmis.js:9 (anonymous) @ openlmis.js:30 processQueue @ openlmis.js:9 (anonymous) @ openlmis.js:9 $digest @ openlmis.js:9 $apply @ openlmis.js:9 (anonymous) @ openlmis.js:10 completeOutstandingRequest @ openlmis.js:6 (anonymous) @ openlmis.js:6 setTimeout (async) Browser.self.defer @ openlmis.js:6 timeout @ openlmis.js:10 (anonymous) @ openlmis.js:31 dispatch @ openlmis.js:3 elemData.handle @ openlmis.js:3
Screenshot attached.
Same error if you navigate to any other Stock Management area: Issue, Receive, and Physical Inventory.
Verified on v3.2.1 on demo.openlmis.org as well as latest snapshot on test.openlmis.org.
Desired Behavior
When a user does not have permissions to do Adjustments, Issue, Receive, and Physical Inventory, then those menu items should not appear on their navigation menu. Remove those 4 links from the Stock Management menu when a user does not have a home facility/not have home facility stock rights.
Why can't a user do these functions? The Stock Management UI only allows users to record Adjustments, Issue, Receive, and Physical Inventory for their own Home Facility. This is a current limitation in place since 3.1.0 through 3.2.1--future versions could become more flexible but not yet.