ERPNext Manual Stock Entry - Auto fetch UOM and show

In ERPNext, in the functionality of Manual Stock Entry, when we create stock rows in Item table, The UoM, Conversion Factor and Stock UoM gets automatically fetched when we select an Item in the row.

I am creating a functionality which is a cut down version of this Stock Entry functionality with one additional business specific field. I want the same thing to happen in my functionality that UoM and conversion factor gets automatically populated as soon as I select an Item.

I duplicated the child table “[Stock Entry Detail]” which is used in " [Stock Entry]" to get multiple stocks and tried to use it to serve the purpose, but it did not work.

The Uom and other related fields does not gets auto populated as I select the item in the row.

How, this is achieved by ERPNext. Can someone give me pointer as in which file the code is written to fetch and populate the UoM on the basis of Item selected.