[FIX] account: Removed mx.DateTime used in yml.

bzr revid: uco@tinyerp.com-20101018115615-abpxhc8d1fewh8wv
This commit is contained in:
uco (OpenERP) 2010-10-18 17:26:15 +05:30
parent f8eb6b0184
commit ed4308e114
1 changed files with 6 additions and 6 deletions

View File

@ -65,21 +65,21 @@
-
!python {model: res.partner}: |
import netsvc, tools, os, time
import datetime
from mx.DateTime import *
from datetime import datetime
from dateutil.relativedelta import relativedelta
import warnings
warnings.filterwarnings('ignore',".*struct integer overflow masking is deprecated*")
start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
start = DateTime(int(start.year), int(start.month), int(start.day))
start = datetime.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
start = datetime(int(start.year), int(start.month), int(start.day))
res = {}
for i in range(5)[::-1]:
stop = start - RelativeDateTime(days=30)
stop = start - relativedelta(days=30)
res[str(i)] = {
'name': (i!=0 and (str((5-(i+1)) * 30) + '-' + str((5-i) * 30)) or ('+'+str(4 * 30))),
'stop': start.strftime('%Y-%m-%d'),
'start': (i!=0 and stop.strftime('%Y-%m-%d') or False),
}
start = stop - RelativeDateTime(days=1)
start = stop - relativedelta(days=1)
obj_move = self.pool.get('account.move.line')
ctx = {}
fy_id = ref('account.data_fiscalyear')