From 03ecc8544fd2fc3b9f1d359b1a77ea4cb9c1e624 Mon Sep 17 00:00:00 2001 From: Maxime Richez Date: Wed, 28 Sep 2022 09:47:03 +0200 Subject: [PATCH] Use left join on currency rate for margin report issue11711 review421731003 --- stock_reporting_margin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_reporting_margin.py b/stock_reporting_margin.py index a3e773e4cc..a760b32ac5 100644 --- a/stock_reporting_margin.py +++ b/stock_reporting_margin.py @@ -86,7 +86,7 @@ class Abstract(ModelSQL, ModelView): query=Currency.currency_rate_sql()) from_item = (move - .join(currency_rate, + .join(currency_rate, type_='LEFT', condition=(move.currency == currency_rate.currency) & (currency_rate.start_date <= move.effective_date) & ((currency_rate.end_date == Null)