Skip to content

Commit

Permalink
fixup! [IMP] make picking state syncing configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspaulb committed Sep 10, 2024
1 parent 6a3195d commit bf28a58
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ def test_confirm_several_picking(self):
def test_sync_picking(self):
self.company_a.sync_picking = True
self.company_b.sync_picking = True
self.company_a.sync_picking_state = True
self.company_b.sync_picking_state = True

purchase = self._create_purchase_order(
self.partner_company_b, self.consumable_product
Expand Down Expand Up @@ -376,6 +378,9 @@ def test_sync_picking(self):
# A backorder should have been made for both
self.assertTrue(len(sale.picking_ids) > 1)
self.assertEqual(len(purchase.picking_ids), len(sale.picking_ids))
# The original orders should now be done.
self.assertEqual(so_picking_id.state, "done")
self.assertEqual(po_picking_id.state, "done")

def test_sync_picking_no_backorder(self):
self.company_a.sync_picking = True
Expand Down Expand Up @@ -453,6 +458,8 @@ def test_sync_picking_lot(self):
)
self.company_a.sync_picking = True
self.company_b.sync_picking = True
self.company_a.sync_picking_state = True
self.company_b.sync_picking_state = True

purchase = self._create_purchase_order(
self.partner_company_b, self.stockable_product_serial
Expand Down Expand Up @@ -527,6 +534,12 @@ def test_sync_picking_lot(self):
po_lots,
msg="Serial 333 already existed, a new one shouldn't have been created",
)
# A backorder should have been made for both
self.assertTrue(len(sale.picking_ids) > 1)
self.assertEqual(len(purchase.picking_ids), len(sale.picking_ids))
# The original orders should now be done.
self.assertEqual(so_picking_id.state, "done")
self.assertEqual(po_picking_id.state, "done")

def test_sync_picking_same_product_multiple_lines(self):
"""
Expand Down Expand Up @@ -659,6 +672,10 @@ def test_update_open_sale_order(self):
"3.0 Units of Consumable Product 2.+instead of 8.0 Units", re.DOTALL
),
)
print(so_picking_id.state)
po_picking_id = purchase.picking_ids
print(po_picking_id.state)
# Upon confirm, I expect here an issue

def test_block_manual_validation(self):
"""
Expand Down

0 comments on commit bf28a58

Please sign in to comment.