[IMP] improved the code for getting date

bzr revid: bde@tinyerp.com-20110728100715-hujz539r1usdeu4w
This commit is contained in:
Bharat (OpenERP)
2011-07-28 15:37:15 +05:30
parent e955394d45
commit 3d103402d2
+1 -2
View File
@@ -2122,8 +2122,7 @@ class account_model(osv.osv):
for model in self.browse(cr, uid, ids, context=context):
context_date = context.get('date')
str_date = time.strptime(context_date,"%Y-%m-%d")
date = datetime.fromtimestamp(mktime(str_date))
date = datetime.strptime(context_date,"%Y-%m-%d")
entry['name'] = model.name%{'year':date.strftime("%Y"), 'month':date.strftime("%m"), 'date': date.strftime("%Y-%m")}
move_id = account_move_obj.create(cr, uid, {
'ref': entry['name'],