Stock Entry using UOM Conversion

Hi All!

As I am implementing UOM conversion in my current project, I notice this use case:

I have a product called “Dummy Item”. Its Default UOM is Case. It has a UOM conversion to Piece with a factor of 100.

So I wanted to transfer from one warehouse to another but insetead of UOM Case, I want to use Piece. I wanted to transfer 50 Pieces of Dummy Item from warehouse 1 to warehouse 2. In “Stock Entry”, I input “0.50” in the Qty with “Piece” as the selected UOM. Stock UOM is “Case” which is correct since it is the set default UOM. But the field “Qty as per Stock UOM”, which is the transfer_qty, is 50. This is supposed to be “0.50” since the quantity is referring to the stock UOM which is Case Please see image below:

Aside from the client side calculation, I also found below validation under “Stock Entry” doctype:

def set_transfer_qty(self):
   for item in self.get("items"):
      if not flt(item.qty):
         frappe.throw(_("Row {0}: Qty is mandatory").format(item.idx))
      if not flt(item.conversion_factor):
         frappe.throw(_("Row {0}: UOM Conversion Factor is mandatory").format(item.idx))
      item.transfer_qty = flt(item.qty * item.conversion_factor, self.precision("transfer_qty", item))

As we can see, it multiplies the Qty to the Conversion_Factor, which I believe, should be divided.

Any thoughts about this? Thanks!

1 Like