Skip to content

Commit

Permalink
Merge PR #891 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Sep 17, 2021
2 parents d6ef04d + 5b20a9b commit 014d56c
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions stock_picking_show_return/tests/test_stock_picking_show_return.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2014-2017 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.tests.common import TransactionCase, tagged
from odoo.tests.common import Form, TransactionCase, tagged


@tagged("post_install", "-at_install")
Expand Down Expand Up @@ -30,20 +30,21 @@ def setUp(self):
}
)

def get_return_picking_wizard(self, picking):
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",
)
)
return stock_return_picking_form.save()

def test_returned_ids_field(self):
self.picking.action_assign()
self.picking.move_line_ids.qty_done = 1
self.picking._action_done()
wizard = (
self.env["stock.return.picking"]
.with_context(
active_ids=self.picking.ids,
active_id=self.picking.id,
active_model="stock.picking",
)
.create({})
)
wizard._onchange_picking_id()
wizard = self.get_return_picking_wizard(self.picking)
wizard.create_returns()
self.picking._compute_returned_ids()
self.assertTrue(self.picking.returned_ids)
Expand All @@ -52,16 +53,7 @@ def test_source_picking_id_field(self):
self.picking.action_assign()
self.picking.move_line_ids.qty_done = 1
self.picking._action_done()
wizard = (
self.env["stock.return.picking"]
.with_context(
active_ids=self.picking.ids,
active_id=self.picking.id,
active_model="stock.picking",
)
.create({})
)
wizard._onchange_picking_id()
wizard = self.get_return_picking_wizard(self.picking)
wizard.create_returns()
self.picking._compute_returned_ids()
picking_returned = self.picking.returned_ids[0]
Expand Down

0 comments on commit 014d56c

Please sign in to comment.