[FIX] stock_account_valuation_report: exclude JE that are not posted

This commit is contained in:
AaronHForgeFlow
2022-08-03 10:28:19 +02:00
committed by Christopher Ormaza
parent 78a32d0903
commit 1c0144a4ff

View File

@@ -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 = (