From 802382f31bb96c7396e3e3c7e57feb582ed3dfa0 Mon Sep 17 00:00:00 2001 From: Ludovic CHEVALIER Date: Tue, 8 Dec 2015 12:14:32 +0100 Subject: [PATCH] [DATE2DATE] fix delta in between date_from and date_to --- remembership.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/remembership.py b/remembership.py index fcd89fe..ad6438f 100644 --- a/remembership.py +++ b/remembership.py @@ -253,7 +253,7 @@ class account_invoice_line(osv.osv): and context.get('date_from') and datetime.strptime(context('date_from'), "%Y-%m-%d") or date.today()) - date_to = date_from + relativedelta(months = +12) # TODO: parameterize this delta? + date_to = date_from + relativedelta(months=+12, days=-1) # TODO: parameterize this delta? date_from = date_from.strftime("%Y-%m-%d") date_to = date_to .strftime("%Y-%m-%d") print ("DEV: [remembership] [account_invoice_line] [write] date_from: %s" % str(date_from)) @@ -325,7 +325,8 @@ class account_invoice_line(osv.osv): and context.get('date_from') and datetime.strptime(context.get('date_from'), "%Y-%m-%d") or date.today()) - date_to = date_from + relativedelta(days = +364) # TODO: parameterize this delta? + print("#DEBUG: Date de début - %s" % str(date_from)) + date_to = date_from + relativedelta(months=+12, days=-1) # TODO: parameterize this delta? date_from = date_from.strftime("%Y-%m-%d") date_to = date_to .strftime("%Y-%m-%d") print ("DEV: [remembership] [account_invoice_line] [create] date_from: %s" % str(date_from)) -- 2.20.1