fix: SCO status on SCR cancel
This commit is contained in:
parent
6f7e67db9d
commit
a7161d3875
@ -192,10 +192,11 @@ class SubcontractingOrder(SubcontractingController):
|
|||||||
status = "Partial Material Transferred"
|
status = "Partial Material Transferred"
|
||||||
if total_supplied_qty >= total_required_qty:
|
if total_supplied_qty >= total_required_qty:
|
||||||
status = "Material Transferred"
|
status = "Material Transferred"
|
||||||
|
else:
|
||||||
|
status = "Open"
|
||||||
elif self.docstatus == 2:
|
elif self.docstatus == 2:
|
||||||
status = "Cancelled"
|
status = "Cancelled"
|
||||||
|
|
||||||
if status:
|
|
||||||
frappe.db.set_value("Subcontracting Order", self.name, "status", status, update_modified)
|
frappe.db.set_value("Subcontracting Order", self.name, "status", status, update_modified)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -96,6 +96,12 @@ class TestSubcontractingOrder(FrappeTestCase):
|
|||||||
sco.load_from_db()
|
sco.load_from_db()
|
||||||
self.assertEqual(sco.status, "Completed")
|
self.assertEqual(sco.status, "Completed")
|
||||||
|
|
||||||
|
# Partially Received (scr cancelled)
|
||||||
|
scr.load_from_db()
|
||||||
|
scr.cancel()
|
||||||
|
sco.load_from_db()
|
||||||
|
self.assertEqual(sco.status, "Partially Received")
|
||||||
|
|
||||||
def test_make_rm_stock_entry(self):
|
def test_make_rm_stock_entry(self):
|
||||||
sco = get_subcontracting_order()
|
sco = get_subcontracting_order()
|
||||||
rm_items = get_rm_items(sco.supplied_items)
|
rm_items = get_rm_items(sco.supplied_items)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user