From 1c0144a4ff635a30589df688e01deb7af5aa1feb Mon Sep 17 00:00:00 2001 From: AaronHForgeFlow Date: Wed, 3 Aug 2022 10:28:19 +0200 Subject: [PATCH] [FIX] stock_account_valuation_report: exclude JE that are not posted --- stock_account_valuation_report/models/product_product.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stock_account_valuation_report/models/product_product.py b/stock_account_valuation_report/models/product_product.py index ca3636f..ab80125 100644 --- a/stock_account_valuation_report/models/product_product.py +++ b/stock_account_valuation_report/models/product_product.py @@ -75,7 +75,9 @@ class ProductProduct(models.Model): sum(aml.balance), sum(quantity), array_agg(aml.id) FROM account_move_line AS aml + INNER JOIN account_move AS am ON am.id = aml.move_id WHERE aml.product_id IN %%s + AND am.state = 'posted' AND aml.company_id=%%s %s GROUP BY aml.product_id, aml.account_id""" params = (