Leave Application not working in ERPnext V4

Hello Guys,
I have been working on Erpnext V4 development for the company since last 3 months but i’m only well-versed with client side scripting and not much with PYTHON and Server side scripting.
I encountered the following error but don’t know how to resolve it:

  • Got 2 User, User A and User B
  • B is Leave Approver of A
    Steps to repro:
  • Log in as User A
  • Add New Leave Application, Select B as Leave Approver
  • The moment I change field to_date or press Save. Error occurs: Not allowed to access User with Leave Approver = us… @gmail .com

It works fine if the user is HR user, but the problem is , we can’t make all the employees, an HR user. Is there sth to do with User Permission ?
Wanted to know whether this issue had been already solved or do we need to it by ourselves??
If to be done by ourselves, can you please ,detail out the procedure ?

P.S.: We have the self-hosted ERPNext version4 using the virtual image install on our local server.

Vizexperts India Pvt. Ltd.

Do you have user permissions?

These are fixed in version 5, you should upgrade your VM

@rmehta Yes I do have the user permissions.
About the upgradation to v5 , I have a doubt and that’s why we’re not updating to V5.
We have done a whole bunch of customizations to version 4 and we doubt that it would go to upgraded v5
since there has been lot of basic changes to the look and features of the doctypes in V5

If possible, How to go about the upgrade if we want to have all the customizations?
If not , what shall be done, to not lose the customizations?