Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisOForgeFlow committed Oct 23, 2024
1 parent dd78212 commit a8184e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 15 additions & 5 deletions rma/tests/test_rma.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from odoo.exceptions import UserError, ValidationError
from odoo.tests import Form, common
from odoo.tools.safe_eval import safe_eval


class TestRma(common.TransactionCase):
Expand Down Expand Up @@ -129,11 +130,20 @@ def _deliver_rma(cls, rma_line_ids):
).create({})
wizard._create_picking()
res = rma_line_ids.action_view_out_shipments()
picking = cls.env["stock.picking"].browse(res["res_id"])
picking.action_assign()
for mv in picking.move_ids:
mv.quantity_done = mv.product_uom_qty
picking._action_done()
picking = cls.env["stock.picking"].browse()
if res["res_id"]:
picking = cls.env["stock.picking"].browse(res["res_id"])
elif res.get("domain", False):
domain = res["domain"]
if isinstance(domain, str):
domain = safe_eval(domain)
picking = cls.env["stock.picking"].browse(domain[0][2])
if picking:
for pick in picking:
pick.action_assign()
for mv in pick.move_ids:
mv.quantity_done = mv.product_uom_qty
pick._action_done()
return picking

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions rma_sale/tests/test_rma_sale_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def setUpClass(cls):

picking.action_assign()

for move in picking.move_lines:
for move in picking.move_ids:
if move.product_id.id == cls.product_serial_2.id:
move.move_line_ids.write({"result_package_id": cls.package_2.id})
if move.product_id.id == cls.product_lot_2.id:
Expand Down Expand Up @@ -145,7 +145,7 @@ def test_01_customer_rma_tracking(self):
"Destination package should not be assigned",
)
picking.action_assign()
for mv in picking.move_lines:
for mv in picking.move_ids:
mv.quantity_done = mv.product_uom_qty
picking._action_done()
self.assertEqual(
Expand Down

0 comments on commit a8184e9

Please sign in to comment.