diff --git a/addons/stock/tests/test_warehouse.py b/addons/stock/tests/test_warehouse.py index a056fddb471..273f3fe64c8 100644 --- a/addons/stock/tests/test_warehouse.py +++ b/addons/stock/tests/test_warehouse.py @@ -247,10 +247,12 @@ class TestWarehouse(TestStockCommon): 'code': 'STK', }) + distribution_partner = self.env['res.partner'].create({'name': 'Distribution Center'}) warehouse_distribution = self.env['stock.warehouse'].create({ 'name': 'Dist.', 'code': 'DIST', - 'resupply_wh_ids': [(6, 0, [warehouse_stock.id])] + 'resupply_wh_ids': [(6, 0, [warehouse_stock.id])], + 'partner_id': distribution_partner.id, }) warehouse_shop = self.env['stock.warehouse'].create({ @@ -307,6 +309,9 @@ class TestWarehouse(TestStockCommon): self.assertTrue(self.env['stock.move'].search([('location_dest_id', '=', warehouse_shop.lot_stock_id.id)])) self.assertTrue(self.env['stock.move'].search([('location_id', '=', warehouse_shop.lot_stock_id.id)])) + self.assertTrue(self.env['stock.picking'].search([('location_id', '=', self.env.company.internal_transit_location_id.id), ('partner_id', '=', distribution_partner.id)])) + self.assertTrue(self.env['stock.picking'].search([('location_dest_id', '=', self.env.company.internal_transit_location_id.id), ('partner_id', '=', distribution_partner.id)])) + def test_mutiple_resupply_warehouse(self): """ Simulate the following situation: - 2 shops with stock are resupply by 2 distinct warehouses