Skip to content

Commit

Permalink
[IMP] rma: Add test_rma_replace_pick_ship
Browse files Browse the repository at this point in the history
TT48789
  • Loading branch information
victoralmau committed Apr 26, 2024
1 parent 4c2ee59 commit 7b2dfd2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rma/tests/test_rma.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,23 @@ def _create_delivery(self):


class TestRmaCase(TestRma):
def test_rma_replace_pick_ship(self):
warehouse = self.env.ref("stock.warehouse0")
warehouse.write({"delivery_steps": "pick_ship"})
rma = self._create_rma(self.partner, self.product, 1, self.rma_loc)
rma.action_confirm()
rma.reception_move_id.quantity_done = 1
rma.reception_move_id.picking_id._action_done()
self.assertEqual(rma.reception_move_id.picking_id.state, "done")
self.assertEqual(rma.state, "received")
res = rma.action_replace()
wizard_form = Form(self.env[res["res_model"]].with_context(**res["context"]))
wizard_form.product_id = self.product
wizard_form.product_uom_qty = rma.product_uom_qty
wizard = wizard_form.save()
wizard.action_deliver()
self.assertEqual(rma.delivery_picking_count, 2)

def test_onchange(self):
rma_form = Form(self.env["rma"])
# If partner changes, the invoice address is set
Expand Down

0 comments on commit 7b2dfd2

Please sign in to comment.