From c8c3536dc9f6f26c381ba0d611a4cf8bbdeb1340 Mon Sep 17 00:00:00 2001 From: Sibert Aerts Date: Fri, 13 Oct 2023 14:36:44 +0200 Subject: [PATCH] [FIX] Fix edge case date bug --- mrp_production_grouped_by_product/models/mrp_production.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mrp_production_grouped_by_product/models/mrp_production.py b/mrp_production_grouped_by_product/models/mrp_production.py index a3d3d2d6f..eb433b254 100644 --- a/mrp_production_grouped_by_product/models/mrp_production.py +++ b/mrp_production_grouped_by_product/models/mrp_production.py @@ -65,8 +65,9 @@ class MrpProduction(models.Model): if date.hour < pt.mo_grouping_max_hour: date_end = date.replace(hour=pt.mo_grouping_max_hour, minute=0, second=0) else: - date_end = date.replace( - day=date.day + 1, hour=pt.mo_grouping_max_hour, minute=0, second=0 + date_end = date + relativedelta(days=1) + date_end = date_end.replace( + hour=pt.mo_grouping_max_hour, minute=0, second=0 ) date_start = date_end - relativedelta(days=pt.mo_grouping_interval) domain += [