Filling out the physical inventory for Essential Meds is slower


During testing, I noticed that adding products and filling in "Current stock" on the physical inventory page for Essential Meds slowed down.

I checked it on both browsers (Firefox and Chrome).

  • Add one product: FF 1.30 min; Chrome: over 2 min.

  • Going to the next field: 40s

*Reproduction steps:

  1. Log in as an administrator or srmanager2.

  2. Go to Stock Management > Physical Inventory.

  3. Click the Start button next to Essential Meds.

  4. Click the Add Product button and try to add some products.

  5. Fill in the Current Stock for all products.

  6. A message appears that the page is slowing down the browser.

Expected results:

  • Actions shouldn't last that long.

I checked that demo-v3 works, these actions are performed in a few seconds, there is no downtime.




Joanna Bebak
October 30, 2020, 1:47 PM

I tested the ticket, and now adding products/moving to another field is very fast when orderables are already saved in cache - the former takes several seconds, the latter is virtually immediate.

Aleksandra Sołtys
October 28, 2020, 2:55 PM

After changes in this commit, the time decreased about 10s, from 25s to 15s

Aleksandra Sołtys
October 28, 2020, 9:38 AM

Most likely the problem is with the efficiency of the getDraft function in physical-inventory-draft-cache.service.js
I measured the time of execution this function and it is about 20-25s. Getting the draft from localStorage takes about 3 seconds, and saving/updating this object to localStorage about 200ms. Therefore, the code that is executed after getting the draft from localStorage should be corrected



Aleksandra Sołtys


Joanna Szymańska