From 4d10f95ebc5a03d14573db825197c2bf304fde37 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Thu, 9 Mar 2023 13:37:12 +0100 Subject: [PATCH] Use inventory company to complete lines Closes #12127 (grafted from 5282d0322326c6abe1b98cb1dee1565064257e4f) --HG-- branch : 6.0 --- modules/stock/inventory.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/stock/inventory.py b/modules/stock/inventory.py index 87f7f0f541..f86ed8f212 100644 --- a/modules/stock/inventory.py +++ b/modules/stock/inventory.py @@ -263,7 +263,9 @@ class Inventory(Workflow, ModelSQL, ModelView): product_ids = None else: product_ids = [l.product.id for l in inventory.lines] - with Transaction().set_context(stock_date_end=inventory.date): + with Transaction().set_context( + company=inventory.company.id, + stock_date_end=inventory.date): pbl = Product.products_by_location( [inventory.location.id], grouping=grouping,