def test_serialized(self): from stock.doctype.stock_entry.test_stock_entry import make_serialized_item from stock.doctype.serial_no.serial_no import get_serial_nos se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) si = webnotes.bean(copy=test_records[0]) si.doc.update_stock = 1 si.doclist[1].item_code = "_Test Serialized Item With Series" si.doclist[1].qty = 1 si.doclist[1].serial_no = serial_nos[0] si.insert() si.submit() self.assertEquals( webnotes.conn.get_value("Serial No", serial_nos[0], "status"), "Delivered") self.assertFalse( webnotes.conn.get_value("Serial No", serial_nos[0], "warehouse")) self.assertEquals( webnotes.conn.get_value("Serial No", serial_nos[0], "delivery_document_no"), si.doc.name) return si
def test_serialize_status(self): from stock.doctype.stock_ledger_entry.stock_ledger_entry import SerialNoStatusError, get_serial_nos from stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) sr = webnotes.bean("Serial No", serial_nos[0]) sr.doc.status = "Not Available" sr.save() dn = webnotes.bean(copy=test_records[0]) dn.doclist[1].item_code = "_Test Serialized Item With Series" dn.doclist[1].qty = 1 dn.doclist[1].serial_no = serial_nos[0] dn.insert() self.assertRaises(SerialNoStatusError, dn.submit)
def test_serialize_status(self): from stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos from stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) sr = webnotes.bean("Serial No", serial_nos[0]) sr.doc.status = "Not Available" sr.save() dn = webnotes.bean(copy=test_records[0]) dn.doclist[1].item_code = "_Test Serialized Item With Series" dn.doclist[1].qty = 1 dn.doclist[1].serial_no = serial_nos[0] dn.insert() self.assertRaises(SerialNoStatusError, dn.submit)
def test_serialized(self): from stock.doctype.stock_entry.test_stock_entry import make_serialized_item from stock.doctype.stock_ledger_entry.stock_ledger_entry import get_serial_nos se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) dn = webnotes.bean(copy=test_records[0]) dn.doclist[1].item_code = "_Test Serialized Item With Series" dn.doclist[1].qty = 1 dn.doclist[1].serial_no = serial_nos[0] dn.insert() dn.submit() self.assertEquals(webnotes.conn.get_value("Serial No", serial_nos[0], "status"), "Delivered") self.assertFalse(webnotes.conn.get_value("Serial No", serial_nos[0], "warehouse")) self.assertEquals(webnotes.conn.get_value("Serial No", serial_nos[0], "delivery_document_no"), dn.doc.name) return dn