Skip to content

Commit

Permalink
Check move state in selection of delivery move
Browse files Browse the repository at this point in the history
  • Loading branch information
grindtildeath authored and guewen committed Aug 27, 2020
1 parent 699c8ac commit fb00973
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions sale_stock_mto_as_mts_orderpoint/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def _run_orderpoints_for_mto_products(self):
for line in self:
delivery_move = line.move_ids.filtered(
lambda m: m.picking_id.picking_type_code == "outgoing"
and m.state not in ("done", "cancel")
)
if (
not delivery_move.is_from_mto_route
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@ def test_mto_as_mts_orderpoint(self):
.search([("product_id", "=", self.product.id)])
)
self.assertTrue(orderpoint)

def test_cancel_sale_order_orderpoint(self):
order = self._create_sale_order()
order.action_confirm()
order.action_cancel()
order.action_draft()
order.action_confirm()
self.assertEqual(order.state, "sale")

0 comments on commit fb00973

Please sign in to comment.