From 0861096f67257bd2bba0676c185e0332db3ca6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 12 Aug 2023 20:10:06 +0200 Subject: [PATCH] Use only stock move with cost price for product cost price history The cost price on stock move is only required by validation so we can not ensure over time that all the stock moves selected have a cost price. Closes #12468 (grafted from adea1ec5dd32ec8f1a353a6f3105b82707485914) --HG-- branch : 6.0 --- modules/product_cost_history/product.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/product_cost_history/product.py b/modules/product_cost_history/product.py index f2dfdadf26..471025b1d9 100644 --- a/modules/product_cost_history/product.py +++ b/modules/product_cost_history/product.py @@ -85,6 +85,7 @@ class ProductCostHistory(ModelSQL, ModelView): database = Transaction().database tables, clause = Move.search_domain([ + ('cost_price', '!=', None), ('state', '=', 'done'), Product()._domain_moves_cost(), # Incoming moves