From 8a499e95d3cfbe3d741c8b4c337f48e961dac89d Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 11 Apr 2022 15:25:16 +0530 Subject: [PATCH] test: uom conversion in stock balance report --- .../stock/report/stock_balance/test_stock_balance.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/stock/report/stock_balance/test_stock_balance.py b/erpnext/stock/report/stock_balance/test_stock_balance.py index 778195c7ba..2783d27878 100644 --- a/erpnext/stock/report/stock_balance/test_stock_balance.py +++ b/erpnext/stock/report/stock_balance/test_stock_balance.py @@ -125,3 +125,13 @@ class TestStockBalance(FrappeTestCase): rows = stock_balance(self.filters.update({"from_date": "2022-01-01"})) self.assertInvariants(rows) self.assertPartialDictionary({"opening_qty": 6, "in_qty": 0}, rows[0]) + + def test_uom_converted_info(self): + + self.item.append("uoms", {"conversion_factor": 5, "uom": "Box"}) + self.item.save() + + self.generate_stock_ledger(self.item.name, [_dict(qty=5, rate=10)]) + + rows = stock_balance(self.filters.update({"include_uom": "Box"})) + self.assertEqual(rows[0].bal_qty_alt, 1)