Merge pull request #34960 from rohitwaghchaure/fixed-stock-entry-type

fix: stock entry type issue
This commit is contained in:
rohitwaghchaure 2023-04-20 18:03:23 +05:30 committed by GitHub
commit 6259c81adc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View File

@ -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(

View File

@ -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)

View File

@ -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):

View File

@ -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)