mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
Merge pull request #434 from ForgeFlow/14.0-fix-rma-procurement-origin
[14.0][FIX] rma: procurement origin
This commit is contained in:
@@ -779,6 +779,8 @@ class TestRma(common.SavepointCase):
|
|||||||
).create({})
|
).create({})
|
||||||
wizard._create_picking()
|
wizard._create_picking()
|
||||||
picking = self.rma_supplier_id.rma_line_ids._get_out_pickings()
|
picking = self.rma_supplier_id.rma_line_ids._get_out_pickings()
|
||||||
|
partner = picking.partner_id
|
||||||
|
self.assertTrue(partner, "Partner is not defined or False")
|
||||||
moves = picking.move_lines
|
moves = picking.move_lines
|
||||||
self.assertEqual(len(moves), 3, "Incorrect number of moves created")
|
self.assertEqual(len(moves), 3, "Incorrect number of moves created")
|
||||||
|
|
||||||
@@ -898,6 +900,8 @@ class TestRma(common.SavepointCase):
|
|||||||
pickings = self.env["stock.picking"].browse(res["res_id"])
|
pickings = self.env["stock.picking"].browse(res["res_id"])
|
||||||
self.assertEqual(len(pickings), 1, "Incorrect number of pickings created")
|
self.assertEqual(len(pickings), 1, "Incorrect number of pickings created")
|
||||||
picking_in = pickings[0]
|
picking_in = pickings[0]
|
||||||
|
partner = picking_in.partner_id
|
||||||
|
self.assertTrue(partner, "Partner is not defined or False")
|
||||||
moves = picking_in.move_lines
|
moves = picking_in.move_lines
|
||||||
self.assertEqual(len(moves), 3, "Incorrect number of moves created")
|
self.assertEqual(len(moves), 3, "Incorrect number of moves created")
|
||||||
|
|
||||||
@@ -1146,3 +1150,20 @@ class TestRma(common.SavepointCase):
|
|||||||
self.assertEqual(rma.qty_to_deliver, 0)
|
self.assertEqual(rma.qty_to_deliver, 0)
|
||||||
self.assertEqual(rma.qty_delivered, 3)
|
self.assertEqual(rma.qty_delivered, 3)
|
||||||
self.assertEqual(len(rma.move_ids), 4)
|
self.assertEqual(len(rma.move_ids), 4)
|
||||||
|
|
||||||
|
def test_09_supplier_rma_single_line(self):
|
||||||
|
rma_line_id = self.rma_supplier_id.rma_line_ids[0].id
|
||||||
|
wizard = self.rma_make_picking.with_context(
|
||||||
|
{
|
||||||
|
"active_ids": [rma_line_id],
|
||||||
|
"active_model": "rma.order.line",
|
||||||
|
"picking_type": "outgoing",
|
||||||
|
"active_id": 2,
|
||||||
|
}
|
||||||
|
).create({})
|
||||||
|
wizard._create_picking()
|
||||||
|
picking = self.rma_supplier_id.rma_line_ids[0]._get_out_pickings()
|
||||||
|
partner = picking.partner_id
|
||||||
|
self.assertTrue(partner, "Partner is not defined or False")
|
||||||
|
moves = picking.move_lines
|
||||||
|
self.assertEqual(len(moves), 1, "Incorrect number of moves created")
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class RmaMakePicking(models.TransientModel):
|
|||||||
procurement_data = {
|
procurement_data = {
|
||||||
"name": line.rma_id and line.rma_id.name or line.name,
|
"name": line.rma_id and line.rma_id.name or line.name,
|
||||||
"group_id": group,
|
"group_id": group,
|
||||||
"origin": line.name,
|
"origin": group and group.name or line.name,
|
||||||
"warehouse_id": warehouse,
|
"warehouse_id": warehouse,
|
||||||
"date_planned": time.strftime(DT_FORMAT),
|
"date_planned": time.strftime(DT_FORMAT),
|
||||||
"product_id": item.product_id,
|
"product_id": item.product_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user