From bf6fb5b760ed47fb021f34830efa588bff59dced 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 --- 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 798753b0d0..b76ffde8ee 100644 --- a/modules/stock/inventory.py +++ b/modules/stock/inventory.py @@ -256,7 +256,9 @@ class Inventory(Workflow, ModelSQL, ModelView): if inventory.state == 'done': continue # Compute product quantities - with Transaction().set_context(stock_date_end=inventory.date): + with Transaction().set_context( + company=inventory.company.id, + stock_date_end=inventory.date): if fill: pbl = Product.products_by_location( [inventory.location.id],