[IMP] stock: set partner for inter-warehouse transfers

Test af13e76629

closes odoo/odoo#87118

X-original-commit: cb93c259bf5e3aac4ae8fbbd071c68c8dd049911
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
This commit is contained in:
Adrien Widart
2022-03-24 12:57:33 +01:00
parent 7d028396e0
commit c3fff714c5
+6 -1
View File
@@ -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