diff --git a/website_sale_aplicoop/models/group_order.py b/website_sale_aplicoop/models/group_order.py index bdfeb44..487b882 100644 --- a/website_sale_aplicoop/models/group_order.py +++ b/website_sale_aplicoop/models/group_order.py @@ -669,17 +669,7 @@ class GroupOrder(models.Model): today = fields.Date.today() - # Skip if no cutoff date - without a cutoff_day there is no weekly cycle - # to close automatically (would confirm ALL draft orders indiscriminately) - if not self.cutoff_date: - _logger.info( - "Cron: Skipping group order %s (%s) - no cutoff_date configured", - self.id, - self.name, - ) - return - - # Skip if cutoff hasn't passed yet (the day is still open for orders) + # Skip if cutoff hasn't passed yet (the cycle is still open for orders) if self.cutoff_date >= today: _logger.info( "Cron: Skipping group order %s (%s) - cutoff date %s not yet passed", @@ -689,21 +679,6 @@ class GroupOrder(models.Model): ) return - # Skip if cutoff was 7+ days ago: it belongs to an already-processed cycle. - # This guards against stale stored dates (e.g. cron was down for several days) - # and prevents confirming orders that were just created for the NEW cycle. - days_since_cutoff = (today - self.cutoff_date).days - if days_since_cutoff >= 7: - _logger.info( - "Cron: Skipping group order %s (%s) - cutoff date %s is stale " - "(%d days ago, already processed)", - self.id, - self.name, - self.cutoff_date, - days_since_cutoff, - ) - return - SaleOrder = self.env["sale.order"].sudo() sale_orders = SaleOrder.search( [