I Still Need Help getting POS module back for One User!

Ok, I am not new to ERPNext and I have been setting up user accounts for a while now. This particular instance has me stumped.

The account in question is my own!!!

About a week or more ago I was demonstrating to another user on the system how to log turn off Desktop Icons from their own account. I demonstrated this by logging into my account and unchecking the box for the POS desk icon in my account. I then demonstrated going back to the desktop and selecting reload to see the icon removed from the desk.

I had no need to call on the POS module in my own account until today, and it is not there to put back on my desktop.

So, I logged in as Administrator and checked if the POS module was still valid. See screen shot:


.
.
Next I went to the “Show / Hide Modules” setting in setup to check if POS was still available to everyone (still logged in as Administrator). See screenshot:


.
.
Then I went to the “User” settings to check on my own settings for module access and icons (and I am still logged in as Administrator). See screenshot:


.
.
After seeing that everything appears to be in order, I logged out of Administrator and logged myself in as myself again. The first thing I did was type POS into the awesome bar and the POS module is NOT there! See screenshot:


.
.
Next I went to my own desktop settings (just like I did the day I demonstrated this) and looked for POS and it is not even available to select!?!

As far as the Administrator is concerned, I should be able to access the POS module, but the reality is that it no longer exists for me (and apparently only me!). No other users are denied access to the POS module.

Does anyone have any ideas about where to look?

I am locked to the following version:

ERPnext: v10.0.14
Frappe Framework: v10.0.22

I need a way to get POS back to my user account. I also need to find a way to do the same in the event it happens to any other user on the system. Since we are not permitted to update or migrate the current version levels (by contract with client), I cannot load any updates that may solve this. I have to find a work around in this version.

If anyone has any ideas that I have not already demonstrated, please post here.

BKM :confounded:

Still struggling with this.

Does anyone have any idea where I can look restore this module to my user?

BKM

I must admit. I am completely stumped by this. I cannot figure out how this user cannot access POS when everything else points to it being there.

BKM

usual culprits

  1. User permissions.

  2. Role permissions

Regards

Caches are another culprit - be sure to Reload

Yup, I have reviewed the permissions several times, but now that the weekend is over I will do it again.

Yup, that is usually the first thing I do. I have even used multiple devices to log into the account, and they all have the same result. So, I don’t believe this could be part of the problem. Thanks.

BKM

Another interesting observation on this…

I have never seen permissions stop a module from being displayed. Normally permissions just deny access when a module is selected.

BKM

@bkm

… have you also tried
bench clear-cache
and
bench clear-web-cache

I´m not sure but it also might logout everyone - be careful not to do it in office hours
?

That is a route I had not considered. That there might be something held up in the system cache. Thank you for the tip. I believe I will try that tonight after everyone is done for the day.

BKM

Okay… I moved a database backup of my system to one of the staging servers and restored it there so I had a safe place to work. The problem of POS module disappearing followed the database restore.

So, I tried your suggested commands anyway. (the second one is actually clear-website-cache) These steps did not help. so I had a different idea.

I logged in as Administrator, removed all references to my BKM login from POS profiles, and other system documents. Next I deleted the user completely and created a new user for myself. As Administrator I also gave myself all module access and all Roles then saved the new user.

When I log out as Administrator and log in as the new user, POS is now missing again!

This tells me that any new user I create will also be denied POS access. As it stands right now, only the users that were previously given POS access before are stil able to access POS.

Even though the Administrator set POS as one of the modules and icons available to everyone, it still does not show up as a selection for the new user.

This new result seems to take the whole thing to a different level. I remember a post a few weeks ago from another forum member that had a similar thing being described, but I cannot seem to find it now.

I am open to other ideas now.

BKM

Well, using my staging system, I think I stumbled onto a work-around for this. It is by no means a good one and it is not one someone could do at a moments notice because it involves messing with bench.

After I had exhausted every combination I could think of in user and role permissions, I started thinking more about the concept of cache thanks to the two kind folks quoted above.

  • In my staging system, I logged in as Administrator and deleted by BKM user account. (I had done this before with no luck).
  • I used SSH into the console and ran the “clear-cache” and “clear-website-cache” bench commands.
  • The only thing I did new this time was issue “sudo reboot” and force the system to reboot and flush anything that mught have been laying around after the clear cache commands.
  • After reboot, I logged back in as Administrator and re-created the BKM user account
  • Logged out as Administrator and logged in as BKM

The POS module was now available to me again.

This is NOT an ideal way to solve this problem, but it was the only way I found to get there. The reboot of the server seems to have been important for some reason. That is really a drastic step that I don;t like to take unless it is for scheduled downtime to do maintenance.

This means, because of the need to issue bench clear cache commands and reboot the server, this can only be done when you can schedule down time.

I think what scares me more than anything else is that I believe this is a hidden BUG that others have stumbled on and possibly were never able to resolve. I remember this came up with a new user not long ago and I didn’t even think it was possible to have it happen. Now that I have found it in my own user account, I am bothered about how severe the issue may really be.

Unfortunately neither myself nor the post I read a few weeks ago had any idea what may have happened to cause the issue. Since it took me so long to realize the module was missing, I have no way to do a forensic study of the history leading to the problem.

Hopefully, a developer takes interest and finds enough clues here to find the root cause.

BKM

2 Likes

wow that is strange… maybe the DB had it in hold or so… Cant see any other reason why the whole shabang went through after reboot.

I wonder whether other permissions and roles then the POS one are affected as well?

Not sure it anything to do with permissions.

When I am working on the staging server, I restore the backup from midnight. After I run down may rabbit holes trying to figure out the cause, I just restore the database again and start over for a new path of discovery.

When I started playing with your cache idea, I had restored the database so all permissions were back to the way they were originally with no changes again.

I tried:

  • the clear cache commands with no relief
  • the clear cache commands, then delete user, then remake user with no relief
  • the delete user, clear cache commands, then remake user with no relief
  • the delete user, clear cache commands, then reboot, then remake user and it worked.

No permissions changes needed to be done to get the final result.

That makes it a scary event.

BKM

Thinking back, the POS desk icon is the only one I “un-checked” when I was demonstrating how to remove icons from one’s own desktop.

But I think the other user that reported something like this on the forum said that all of their modules disappeared unless you were logged in as Administrator. I just don;t remember.

However, your point about it affecting other modules I believe is very likely. I just picked a random icon to uncheck during my demonstration, but it could easily have been purchasing or Sales Invoices, etc.

So, I think this is still lurking out there and will surface again with someone else on the forum. The problem with issues like this is they have no clear path to their cause. That makes this kind of stuff hard to track down and fix.

BKM

no what I meant was that the DB might have had in its own cache I´m not shure whether bench clear cache flushes everything so the DB cache as well…

Yeah totally agree… unfortunately I´m not too familiar with the strukture of the frappe code which I suspect to be the origin of that malarkey since that is the backend app that provides database access and permissions so its gonna be a bit like the needle in a heystack thing to track that down - but again I´m on a fishing expedition here so I could be miles away from the solution.
well I´ll try look into that within the next couple of days.
Did you manage to get your production environment back to normal then?

"
This tells me that any new user I create will also be denied POS access. As it stands right now, only the users that were previously given POS access before are stil able to access POS.

Even though the Administrator set POS as one of the modules and icons available to everyone, it still does not show up as a selection for the new user.

This new result seems to take the whole thing to a different level. I remember a post a few weeks ago from another forum member that had a similar thing being described, but I cannot seem to find it now.
"
So you uncovered a workaround for your case, but stumbled on the above case in the process.

Once you confirm the above is reproducible please add it for the record, thanks Issues · frappe/erpnext · GitHub

No, I can’t do that until after midnight tonight when I know the system will be quiet enough for me to take it down a few minutes.

BKM

So once I have a much better feel for how to reproduce all the issues, I will add them to the list. I have a few items on that list already, but they don’t seem to get much traction. I logged a BUG report there 9 days ago related to the install.py and still no action.

BKM

Well, I must say @olamide_shodunke your prediction was the closest to the actual cause of the disappearing module issue.

The only reason the deleting, clearing cache, and recreating the user account worked was because the new account would always get all roles enabled. As soon as you disable the Sales User role you were in trouble again.

It turns out that Role Permissions do NOT work the way you would expect. In this case it was Role Permissions that made the POS module completely disappear from my user account.

  • If you disable the Sales User in your user account and just leave Sales Manager as you only sales role, The POS module will disappear.
  • There is no POS USER document type available in the Role Permissions manager to select and apply Role Permissions to.
  • There is however POS Profile, POS Profile User, and POS Settings document types in the list. So I made sure to add “Sales Manager” roles to all 3 of these doc types but the POS module would still disappear if I disabled the “Sales User” role in my user account.
  • The only thing left that I could think of is the “Sales Invoice” doc type, so I made sure it also included all permissions for the Sales Manager role. Again, it made no difference. If I disable the Sales User role in my user profile, the POS module disappears again.

In Conclusion…

  • I can prove that Role Permissions are affecting whether POS module appears in my user account.
  • I CANNOT find a condition where the POS module is available to me if I have Sales User role disabled in my user account (even if I have Sales Manager enabled).
  • I cannot find ANY combination of roles that will allow me to have the POS module in my account unless I enable the Sales User role.
  • This is very reproducible by anyone on v10 ERPnext

This presents a conflict of interests in the ERPNext system.

I have used the Role permissions to allow Sales Users roles to only see sales register reports with their specific owner transaction listed. But the Sales Manager can open the same report and change the owner to any of the users.

However, ERPNext seems to be broken in the Role Permissions because if I have both the Sales User and the Sales Manager roles enabled in my user account, then the system defaults to the lowest order of the roles and only allows me to see the Sales Register for my own Sales transactions.

If I disable the Sales User role in my user account then I can properly see the Sales Register reports for any of the Sales Users. However, then I can no longer make sales through the POS module because disabling the Sales User role takes the POS module away.

What a nightmare!

Role Permissions are screwed up in their current implementation.

In order to do everything I need to do, I have to use 2 separate user accounts!!!

  • I need my regular user account with all the manager roles enabled to do the majority of my work.
  • If I need to sell anything through the POS module I must log in with an second account that has the Sales User module enabled.

I just don’t get it. There does NOT appear to be a way to have a Sales Manager to be able to use the POS module unles he also has the Sales User role enabled in his user account. That just makes NO sense at all.

BKM