From 980080208dc59ca121d87491db301e49ac7c6ee9 Mon Sep 17 00:00:00 2001 From: lreficent Date: Wed, 10 May 2017 14:28:17 +0200 Subject: [PATCH] [9.0][FIX] stock_cycle_count: Do not propose cycle counts in the past. --- stock_cycle_count/models/stock_cycle_count_rule.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stock_cycle_count/models/stock_cycle_count_rule.py b/stock_cycle_count/models/stock_cycle_count_rule.py index 00b988ead..6a952ce8c 100644 --- a/stock_cycle_count/models/stock_cycle_count_rule.py +++ b/stock_cycle_count/models/stock_cycle_count_rule.py @@ -152,6 +152,8 @@ class StockCycleCountRule(models.Model): latest_inventory, DEFAULT_SERVER_DATETIME_FORMAT) + timedelta( days=period) + if next_date < datetime.today(): + next_date = datetime.today() except Exception as e: raise UserError( _('Error found determining the frequency of periodic '