fix(test): manually select picked_qty since before_submit validates qty instead of auto filling it
This commit is contained in:
parent
5ff471e22f
commit
c2335ec0d8
@ -411,6 +411,8 @@ class TestPickList(FrappeTestCase):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
pick_list.set_item_locations()
|
pick_list.set_item_locations()
|
||||||
|
for location in pick_list.locations:
|
||||||
|
location.picked_qty = location.stock_qty
|
||||||
pick_list.submit()
|
pick_list.submit()
|
||||||
|
|
||||||
delivery_note = create_delivery_note(pick_list.name)
|
delivery_note = create_delivery_note(pick_list.name)
|
||||||
@ -527,6 +529,8 @@ class TestPickList(FrappeTestCase):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
pick_list.set_item_locations()
|
pick_list.set_item_locations()
|
||||||
|
for location in pick_list.locations:
|
||||||
|
location.picked_qty = location.stock_qty
|
||||||
pick_list.submit()
|
pick_list.submit()
|
||||||
create_delivery_note(pick_list.name)
|
create_delivery_note(pick_list.name)
|
||||||
for dn in frappe.get_all(
|
for dn in frappe.get_all(
|
||||||
@ -571,6 +575,8 @@ class TestPickList(FrappeTestCase):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
pick_list_1.set_item_locations()
|
pick_list_1.set_item_locations()
|
||||||
|
for location in pick_list_1.locations:
|
||||||
|
location.picked_qty = location.stock_qty
|
||||||
pick_list_1.submit()
|
pick_list_1.submit()
|
||||||
create_delivery_note(pick_list_1.name)
|
create_delivery_note(pick_list_1.name)
|
||||||
for dn in frappe.get_all(
|
for dn in frappe.get_all(
|
||||||
@ -591,7 +597,8 @@ class TestPickList(FrappeTestCase):
|
|||||||
pl = create_pick_list(so.name)
|
pl = create_pick_list(so.name)
|
||||||
# pick half the qty
|
# pick half the qty
|
||||||
for loc in pl.locations:
|
for loc in pl.locations:
|
||||||
loc.picked_qty = loc.stock_qty / 2
|
loc.stock_qty = loc.stock_qty /2
|
||||||
|
loc.picked_qty = loc.stock_qty
|
||||||
pl.save()
|
pl.save()
|
||||||
pl.submit()
|
pl.submit()
|
||||||
|
|
||||||
@ -611,6 +618,7 @@ class TestPickList(FrappeTestCase):
|
|||||||
pl.save()
|
pl.save()
|
||||||
self.assertEqual(len(pl.locations), 2)
|
self.assertEqual(len(pl.locations), 2)
|
||||||
for item in pl.locations:
|
for item in pl.locations:
|
||||||
|
item.picked_qty = item.stock_qty
|
||||||
self.assertEqual(item.stock_qty, bundle_items[item.item_code] * 3)
|
self.assertEqual(item.stock_qty, bundle_items[item.item_code] * 3)
|
||||||
|
|
||||||
# check picking status on sales order
|
# check picking status on sales order
|
||||||
@ -636,7 +644,8 @@ class TestPickList(FrappeTestCase):
|
|||||||
|
|
||||||
pl = create_pick_list(so.name)
|
pl = create_pick_list(so.name)
|
||||||
for loc in pl.locations:
|
for loc in pl.locations:
|
||||||
loc.picked_qty = loc.qty / 2
|
loc.stock_qty = loc.stock_qty / 2
|
||||||
|
loc.picked_qty = loc.stock_qty
|
||||||
|
|
||||||
pl.save().submit()
|
pl.save().submit()
|
||||||
so.reload()
|
so.reload()
|
||||||
@ -649,6 +658,8 @@ class TestPickList(FrappeTestCase):
|
|||||||
self.assertEqual(so.per_delivered, 50)
|
self.assertEqual(so.per_delivered, 50)
|
||||||
|
|
||||||
pl = create_pick_list(so.name)
|
pl = create_pick_list(so.name)
|
||||||
|
for loc in pl.locations:
|
||||||
|
loc.picked_qty = loc.stock_qty
|
||||||
pl.save().submit()
|
pl.save().submit()
|
||||||
so.reload()
|
so.reload()
|
||||||
self.assertEqual(so.per_picked, 100)
|
self.assertEqual(so.per_picked, 100)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user