From 30fb3f7c4cfcfd3adefe2543490960a23e5db0a1 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 28 Dec 2016 12:36:10 +0100 Subject: [PATCH] [FIX] stock: Making inventory adjustments in multi companies With Company A (Warehouse Wa) and Company B (Warehouse Wb) When making inventory adjustments for Warehouse Wb in company A, the inventory lines displayed must only be the lines of the company A in the Wb. In this way, the user avoids confusion with the adjustments he is creating. opw:697182 --- addons/stock/stock.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 1147c4f8df6..a55bfbd0d10 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3087,6 +3087,9 @@ class stock_inventory(osv.osv): location_ids = location_obj.search(cr, uid, [('id', 'child_of', [inventory.location_id.id])], context=context) domain = ' location_id in %s' args = (tuple(location_ids),) + if inventory.company_id.id: + domain += ' and company_id = %s' + args += (inventory.company_id.id,) if inventory.partner_id: domain += ' and owner_id = %s' args += (inventory.partner_id.id,)