Skip to content

Commit

Permalink
test: item-wh repost creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Nov 25, 2021
1 parent 6dc9b82 commit a36c249
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion erpnext/controllers/stock_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,6 @@ def create_item_wise_repost_entries(voucher_type, voucher_no, allow_zero_rate=Fa
group_by="item_code, warehouse"
)
distinct_item_warehouses = set()

repost_entries = []

for sle in stock_ledger_entries:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import frappe

from erpnext.controllers.stock_controller import create_item_wise_repost_entries
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
from erpnext.stock.doctype.repost_item_valuation.repost_item_valuation import (
in_configured_timeslot,
)
Expand Down Expand Up @@ -70,3 +72,15 @@ def test_repost_time_slot(self):
in_configured_timeslot(repost_settings, case.get("current_time")),
msg=f"Exepcted false from : {case}",
)

def test_create_item_wise_repost_item_valuation_entries(self):
pr = make_purchase_receipt(company="_Test Company with perpetual inventory",
warehouse = "Stores - TCP1", get_multiple_items = True)

rivs = create_item_wise_repost_entries(pr.doctype, pr.name)
self.assertGreaterEqual(len(rivs), 2)
self.assertIn("_Test Item", [d.item_code for d in rivs])

for riv in rivs:
self.assertEqual(riv.company, "_Test Company with perpetual inventory")
self.assertEqual(riv.warehouse, "Stores - TCP1")

0 comments on commit a36c249

Please sign in to comment.