Skip to content
Snippets Groups Projects
Commit 7915f499 authored by Mantavya Gajjar's avatar Mantavya Gajjar
Browse files

[FIX]: fix a date calculation for -ve

bzr revid: mga@tinyerp.com-20100809175436-a1j4ug1qrh5cxzs3
parent eda647c9
Branches
Tags
No related merge requests found
......@@ -82,7 +82,7 @@ class account_payment_term(osv.osv):
next_date = (datetime.strptime(date_ref, '%Y-%m-%d') + relativedelta(days=line.days))
if line.days2 < 0:
nyear = next_date.strftime("%Y")
nmonth = str(int(next_date.strftime("%m"))% 12+2)
nmonth = str(int(next_date.strftime("%m"))% 12+1)
nday = "1"
ndate = "%s-%s-%s" % (nyear, nmonth, nday)
......@@ -91,7 +91,6 @@ class account_payment_term(osv.osv):
delta = timedelta(seconds=1)
next_date = next_month - delta
next_date = next_date + relativedelta(days=line.days2)
if line.days2 > 0:
next_date += relativedelta(day=line.days2, months=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment