This commit is contained in:
Christopher Ormaza
2024-10-23 10:17:08 -05:00
parent dd78212297
commit a8184e93f9
2 changed files with 17 additions and 7 deletions

View File

@@ -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):
@@ -129,11 +130,20 @@ class TestRma(common.TransactionCase):
).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