From ed208194323a85b49bead2f593076c44dc0117f4 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 24 Dec 2020 16:24:10 +0530 Subject: [PATCH] fix: travis --- .../stock/doctype/purchase_receipt/test_purchase_receipt.py | 2 +- erpnext/stock/doctype/serial_no/serial_no.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 9b8eeed1a1..5921651fec 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -527,7 +527,7 @@ class TestPurchaseReceipt(unittest.TestCase): se = make_stock_entry(item_code=item_code, target="_Test Warehouse - _TC", qty=1, serial_no=serial_no, basic_rate=100, do_not_submit=True) - self.assertRaises(SerialNoDuplicateError, se.submit) + se.submit() def test_auto_asset_creation(self): asset_item = "Test Asset Item" diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 25ce2d5969..86f3c1f561 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -365,8 +365,8 @@ def has_serial_no_exists(sn, sle): status = True # If status is receipt then system will allow to in-ward the delivered serial no - if (status and sle.voucher_type == 'Stock Entry' and - frappe.db.get_value('Stock Entry', sle.voucher_no, 'purpose') == 'Material Receipt'): + if (status and sle.voucher_type == "Stock Entry" and frappe.db.get_value("Stock Entry", + sle.voucher_no, "purpose") in ("Material Receipt", "Material Transfer")): status = False return status