Skip to content

Commit

Permalink
[FIX] Fixed tests --5
Browse files Browse the repository at this point in the history
  • Loading branch information
ptsuva committed Jun 7, 2024
1 parent 323bfd4 commit 3fa1a5b
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions sale_line_returned_qty/tests/test_sale_line_returned_qty.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _return_picking(self, picking, qty, to_refund=True):
return_wiz.product_return_moves.to_refund = to_refund
res = return_wiz.create_returns()
return_picking = self.env["stock.picking"].browse(res["res_id"])
self._validate_picking(return_picking)
return_picking.button_validate()

def _validate_picking(self, picking):
"""Helper method to confirm the pickings"""
Expand All @@ -64,18 +64,5 @@ def test_returned_qty(self):
self.assertEqual(picking.state, "done")
self.assertEqual(so_line.qty_returned, 0.0)
# Make a return for 5 units
stock_return_picking_form = Form(
self.env["stock.return.picking"].with_context(
active_ids=picking.ids,
active_id=picking.ids[0],
active_model="stock.picking",
)
)
stock_return_picking = stock_return_picking_form.save()
stock_return_picking.product_return_moves.quantity = 5.0
stock_return_picking_action = stock_return_picking.create_returns()
return_picking = self.env["stock.picking"].browse(
stock_return_picking_action["res_id"]
)
return_picking.button_validate()
self._return_picking(picking, 5.0, to_refund=True)
self.assertEqual(so_line.qty_returned, 5.0)

0 comments on commit 3fa1a5b

Please sign in to comment.