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
Log in as an administrator or srmanager2.
Go to Stock Management > Physical Inventory.
Click the Start button next to Essential Meds.
Click the Add Product button and try to add some products.
Fill in the Current Stock for all products.
A message appears that the page is slowing down the browser.
Actions shouldn't last that long.
I checked that demo-v3 works, these actions are performed in a few seconds, there is no downtime.
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.
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