From c3fff714c5cec2e96321fdc391fa7c2e2ba8851f Mon Sep 17 00:00:00 2001 From: Adrien Widart Date: Thu, 17 Mar 2022 10:15:24 +0000 Subject: [PATCH] [IMP] stock: set partner for inter-warehouse transfers Test af13e76629d0ad1684f2be26a578f210ea4f1552 closes odoo/odoo#87118 X-original-commit: cb93c259bf5e3aac4ae8fbbd071c68c8dd049911 Signed-off-by: Steve Van Essche Signed-off-by: Adrien Widart --- addons/stock/tests/test_warehouse.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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