From dba80a28d8f3ebcb77ddbcaa06b803cd644acd4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 21 Oct 2021 00:13:42 +0200 Subject: [PATCH] Take the full partition as frame to get last value of cost issue10861 review366091002 (grafted from ddb0a53aa41faf0790fbbe0ce474b9dca6c03c84) --HG-- branch : 6.0 --- product.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/product.py b/product.py index 9330e5f614..f2dfdadf26 100644 --- a/product.py +++ b/product.py @@ -97,6 +97,7 @@ class ProductCostHistory(ModelSQL, ModelView): if database.has_window_functions(): window = Window( [move.effective_date, move.product], + frame='ROWS', start=None, end=None, order_by=[move.write_date.asc, move.id.asc]) cost_price = LastValue(move.cost_price, window=window) else: @@ -124,6 +125,7 @@ class ProductCostHistory(ModelSQL, ModelView): if database.has_window_functions(): window = Window( [price_date, history.product], + frame='ROWS', start=None, end=None, order_by=[price_datetime.asc]) cost_price = LastValue(history.cost_price, window=window) else: