Permalink
Browse files

[IMP] Improve testcase Move cancel propagation RFQ and PO[4-2].

  • Loading branch information...
anr-odoo committed Feb 4, 2019
1 parent 7e366e9 commit 825dcf5b527bb4aa933e422dd981a8e1b130f7de
Showing with 15 additions and 15 deletions.
  1. +15 −15 addons/purchase_stock/tests/test_move_cancel_propagation.py
@@ -104,9 +104,9 @@ def test_cancel_draft_purchase_order_two_steps(self):
# Po should be create related sale order.
self.assertTrue(po, 'purchase order is created.')

internal = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.int_type_id)
pick = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pick_type_id)
out = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.out_type_id)
internal = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.int_type_id)
pick = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pick_type_id)
out = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.out_type_id)

# Check status of Purchase Order
self.assertEqual(po.state, 'draft', "Purchase order should be in 'draft' state.")
@@ -134,19 +134,19 @@ def test_cancel_confirm_purchase_order_two_steps(self):
# Po should be create related sale order.
self.assertTrue(po, 'purchase order is created.')

internal = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.int_type_id)
pick = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pick_type_id)
out = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.out_type_id)
internal = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.int_type_id)
pick = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pick_type_id)
out = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.out_type_id)

# Check status of Purchase Order
po.button_confirm()
picking_in = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.in_type_id)

# Cancel Purchase order.
po.button_cancel()

# Check the status of picking after canceling po.
self.assertEquals(picking_in.state, 'cancel')

self.assertEquals(internal.state, 'cancel')
self.assertNotEqual(pick.state, 'cancel')
self.assertNotEqual(out.state, 'cancel')
@@ -167,10 +167,10 @@ def test_cancel_draft_purchase_order_three_steps(self):
# Po should be create related sale order.
self.assertTrue(po, 'purchase order is created.')

internal = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.int_type_id)
pick = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pick_type_id)
pack = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pack_type_id)
out = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.out_type_id)
internal = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.int_type_id)
pick =self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pick_type_id)
pack = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pack_type_id)
out =self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.out_type_id)

# Check status of Purchase Order
self.assertEqual(po.state, 'draft', "Purchase order should be in 'draft' state.")
@@ -200,10 +200,10 @@ def test_cancel_confirm_purchase_order__three_steps(self):
# Po should be create related sale order.
self.assertTrue(po, 'purchase order is created.')

internal = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.int_type_id)
pack = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pack_type_id)
pick = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pick_type_id)
out = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.out_type_id)
internal = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.int_type_id)
pack = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pack_type_id)
pick = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.pick_type_id)
out = self.order.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.out_type_id)

po.button_confirm()
picking_in = po.picking_ids.filtered(lambda r: r.picking_type_id == self.warehouse.in_type_id)

0 comments on commit 825dcf5

Please sign in to comment.