From bd48f905fc0d1e7281cfb648b5cf9846f37df815 Mon Sep 17 00:00:00 2001 From: Ernesto Tejeda Date: Tue, 15 Sep 2020 17:33:05 -0400 Subject: [PATCH] [IMP] rma: incoming picking type use existing lot by default. --- rma/models/stock_warehouse.py | 4 ++-- rma/tests/test_rma.py | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rma/models/stock_warehouse.py b/rma/models/stock_warehouse.py index 5896accd..cf2281c1 100644 --- a/rma/models/stock_warehouse.py +++ b/rma/models/stock_warehouse.py @@ -72,8 +72,8 @@ class StockWarehouse(models.Model): 'rma_in_type_id': { 'name': _('RMA Receipts'), 'code': 'incoming', - 'use_create_lots': True, - 'use_existing_lots': False, + 'use_create_lots': False, + 'use_existing_lots': True, 'default_location_src_id': False, 'default_location_dest_id': self.rma_loc_id.id, 'sequence': max_sequence + 1, diff --git a/rma/tests/test_rma.py b/rma/tests/test_rma.py index a2997592..b6310ece 100644 --- a/rma/tests/test_rma.py +++ b/rma/tests/test_rma.py @@ -648,3 +648,11 @@ class TestRma(SavepointCase): self.assertTrue(rma.can_be_refunded) self.assertTrue(rma.can_be_returned) self.assertTrue(rma.can_be_replaced) + + def test_rma_picking_type_default_values(self): + warehouse = self.env['stock.warehouse'].create({ + 'name': 'Stock - RMA Test', + 'code': 'SRT', + }) + self.assertFalse(warehouse.rma_in_type_id.use_create_lots) + self.assertTrue(warehouse.rma_in_type_id.use_existing_lots)