fix: stock entry type issue
This commit is contained in:
parent
47b653db6d
commit
c3b5dcb767
@ -616,7 +616,7 @@ def make_stock_entry(source_name, target_doc=None):
|
||||
target.set_transfer_qty()
|
||||
target.set_actual_qty()
|
||||
target.calculate_rate_and_amount(raise_error_if_no_rate=False)
|
||||
target.set_stock_entry_type()
|
||||
target.stock_entry_type = target.purpose
|
||||
target.set_job_card_data()
|
||||
|
||||
doclist = get_mapped_doc(
|
||||
|
@ -54,6 +54,8 @@ class TestMaterialRequest(FrappeTestCase):
|
||||
mr.submit()
|
||||
se = make_stock_entry(mr.name)
|
||||
|
||||
self.assertEqual(se.stock_entry_type, "Material Transfer")
|
||||
self.assertEqual(se.purpose, "Material Transfer")
|
||||
self.assertEqual(se.doctype, "Stock Entry")
|
||||
self.assertEqual(len(se.get("items")), len(mr.get("items")))
|
||||
|
||||
@ -69,6 +71,8 @@ class TestMaterialRequest(FrappeTestCase):
|
||||
in_transit_warehouse = get_in_transit_warehouse(mr.company)
|
||||
se = make_in_transit_stock_entry(mr.name, in_transit_warehouse)
|
||||
|
||||
self.assertEqual(se.stock_entry_type, "Material Transfer")
|
||||
self.assertEqual(se.purpose, "Material Transfer")
|
||||
self.assertEqual(se.doctype, "Stock Entry")
|
||||
for row in se.get("items"):
|
||||
self.assertEqual(row.t_warehouse, in_transit_warehouse)
|
||||
|
@ -2346,7 +2346,7 @@ def move_sample_to_retention_warehouse(company, items):
|
||||
@frappe.whitelist()
|
||||
def make_stock_in_entry(source_name, target_doc=None):
|
||||
def set_missing_values(source, target):
|
||||
target.set_stock_entry_type()
|
||||
target.stock_entry_type = "Material Transfer"
|
||||
target.set_missing_values()
|
||||
|
||||
def update_item(source_doc, target_doc, source_parent):
|
||||
|
@ -202,6 +202,9 @@ class TestStockEntry(FrappeTestCase):
|
||||
)
|
||||
|
||||
end_transit_entry = make_stock_in_entry(transit_entry.name)
|
||||
|
||||
self.assertEqual(end_transit_entry.stock_entry_type, "Material Transfer")
|
||||
self.assertEqual(end_transit_entry.purpose, "Material Transfer")
|
||||
self.assertEqual(transit_entry.name, end_transit_entry.outgoing_stock_entry)
|
||||
self.assertEqual(transit_entry.name, end_transit_entry.items[0].against_stock_entry)
|
||||
self.assertEqual(transit_entry.items[0].name, end_transit_entry.items[0].ste_detail)
|
||||
|
Loading…
x
Reference in New Issue
Block a user