[IMP] improved the code for getting date
authorBharat (OpenERP) <bde@tinyerp.com>
Thu, 28 Jul 2011 10:07:15 +0000 (15:37 +0530)
committerBharat (OpenERP) <bde@tinyerp.com>
Thu, 28 Jul 2011 10:07:15 +0000 (15:37 +0530)
bzr revid: bde@tinyerp.com-20110728100715-hujz539r1usdeu4w

addons/account/account.py

index 0364858..8e653bd 100644 (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'],