diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index 8a1f8c7f697..398a7c67da1 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -74,11 +74,12 @@ class TestStockEntry(unittest.TestCase): from erpnext.stock.doctype.item.test_item import make_item_variant make_item_variant() self._test_auto_material_request("_Test Item") + self._test_auto_material_request("_Test Item", material_request_type="Transfer") def test_auto_material_request_for_variant(self): self._test_auto_material_request("_Test Variant Item-S") - def _test_auto_material_request(self, item_code): + def _test_auto_material_request(self, item_code, material_request_type="Purchase"): item = frappe.get_doc("Item", item_code) if item.variant_of: @@ -101,6 +102,7 @@ class TestStockEntry(unittest.TestCase): # update re-level qty so that it is more than projected_qty if projected_qty >= template.reorder_levels[0].warehouse_reorder_level: template.reorder_levels[0].warehouse_reorder_level += projected_qty + template.reorder_levels[0].material_request_type = material_request_type template.save() from erpnext.stock.reorder_item import reorder_item diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py index bf06396c342..ff943d23d75 100644 --- a/erpnext/stock/reorder_item.py +++ b/erpnext/stock/reorder_item.py @@ -114,7 +114,7 @@ def create_material_request(material_requests): mr.update({ "company": company, "transaction_date": nowdate(), - "material_request_type": request_type + "material_request_type": "Material Transfer" if request_type=="Transfer" else request_type }) for d in items: