mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
fix: ci
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from odoo.exceptions import UserError, ValidationError
|
from odoo.exceptions import UserError, ValidationError
|
||||||
from odoo.tests import Form, common
|
from odoo.tests import Form, common
|
||||||
|
from odoo.tools.safe_eval import safe_eval
|
||||||
|
|
||||||
|
|
||||||
class TestRma(common.TransactionCase):
|
class TestRma(common.TransactionCase):
|
||||||
@@ -129,11 +130,20 @@ class TestRma(common.TransactionCase):
|
|||||||
).create({})
|
).create({})
|
||||||
wizard._create_picking()
|
wizard._create_picking()
|
||||||
res = rma_line_ids.action_view_out_shipments()
|
res = rma_line_ids.action_view_out_shipments()
|
||||||
|
picking = cls.env["stock.picking"].browse()
|
||||||
|
if res["res_id"]:
|
||||||
picking = cls.env["stock.picking"].browse(res["res_id"])
|
picking = cls.env["stock.picking"].browse(res["res_id"])
|
||||||
picking.action_assign()
|
elif res.get("domain", False):
|
||||||
for mv in picking.move_ids:
|
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
|
mv.quantity_done = mv.product_uom_qty
|
||||||
picking._action_done()
|
pick._action_done()
|
||||||
return picking
|
return picking
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class TestRmaSaleTracking(TestRma):
|
|||||||
|
|
||||||
picking.action_assign()
|
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:
|
if move.product_id.id == cls.product_serial_2.id:
|
||||||
move.move_line_ids.write({"result_package_id": cls.package_2.id})
|
move.move_line_ids.write({"result_package_id": cls.package_2.id})
|
||||||
if move.product_id.id == cls.product_lot_2.id:
|
if move.product_id.id == cls.product_lot_2.id:
|
||||||
@@ -145,7 +145,7 @@ class TestRmaSaleTracking(TestRma):
|
|||||||
"Destination package should not be assigned",
|
"Destination package should not be assigned",
|
||||||
)
|
)
|
||||||
picking.action_assign()
|
picking.action_assign()
|
||||||
for mv in picking.move_lines:
|
for mv in picking.move_ids:
|
||||||
mv.quantity_done = mv.product_uom_qty
|
mv.quantity_done = mv.product_uom_qty
|
||||||
picking._action_done()
|
picking._action_done()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
|||||||
Reference in New Issue
Block a user