From eb1ddbf115b6e543777de6003b9c678c1e8d1f0e Mon Sep 17 00:00:00 2001 From: Adrien Widart Date: Thu, 17 Feb 2022 14:44:04 +0000 Subject: [PATCH] [FIX] stock: compute replenishment info The history of the replenishment info may be empty while it should not To reproduce the issue: (Set your device on January) 1. Process a delivery for product P 2. (Inventory > Operations > Replenishment, create a new one for P) 3. Click on the information icon (I) of the P's line Error: The sales history does contain anything When calling `relativedelta`, `month` is considered as an absolute value and will replace the corresponding value while `months` is a relative value and will be added/subtracted to the corresponding value. OPW-2740123 closes odoo/odoo#84881 X-original-commit: c87fea0916b61cb4b0c37f3fe2ddad8359e6aeb2 Signed-off-by: Arnold Moyaux Signed-off-by: Adrien Widart --- addons/stock/wizard/stock_replenishment_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/wizard/stock_replenishment_info.py b/addons/stock/wizard/stock_replenishment_info.py index bdb25d9077c..440f2be68cd 100644 --- a/addons/stock/wizard/stock_replenishment_info.py +++ b/addons/stock/wizard/stock_replenishment_info.py @@ -49,7 +49,7 @@ class StockReplenishmentInfo(models.TransientModel): for replenishment_report in self: replenishment_history = [] today = fields.Datetime.now() - first_month = subtract(today, month=2) + first_month = subtract(today, months=2) date_from, dummy = get_month(first_month) dummy, date_to = get_month(today) domain = [