[Erp5-report] r43681 jerome - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_s...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 24 17:02:39 CET 2011


Author: jerome
Date: Thu Feb 24 17:02:39 2011
New Revision: 43681

URL: http://svn.erp5.org?rev=43681&view=rev
Log:
when creating secondary periods, create the date in their "normal" timezone.

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createSecondaryPeriod.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createSecondaryPeriod.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createSecondaryPeriod.xml?rev=43681&r1=43680&r2=43681&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createSecondaryPeriod.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createSecondaryPeriod.xml [utf8] Thu Feb 24 17:02:39 2011
@@ -52,6 +52,7 @@
             <key> <string>_body</string> </key>
             <value> <string encoding="cdata"><![CDATA[
 
+from DateTime import DateTime\n
 from Products.ERP5Type.DateUtils import addToDate\n
 from Products.ERP5Type.Message import translateString\n
 \n
@@ -62,12 +63,19 @@ if frequency == \'quarterly\':\n
 date = context.getStartDate()\n
 while date < context.getStopDate():\n
   end_date = addToDate(date, dict(month=month_added))\n
+  # recreate a DateTime to have it in the proper timezone\n
+  start_date = DateTime(date.year(), date.month(), date.day())\n
+  stop_date = DateTime((end_date - 1).year(),\n
+                       (end_date - 1).month(),\n
+                       (end_date - 1).day())\n
+\n
   period = context.newContent(portal_type=\'Accounting Period\',\n
-                     start_date=date,\n
-                     stop_date=end_date - 1,)\n
+                              start_date=start_date,\n
+                              stop_date=stop_date)\n
 \n
   if frequency == \'quarterly\':\n
-    period.setShortTitle(\'%s-%s\' % (date.strftime(\'%Y %m\'), (end_date - 1).strftime(\'%m\')))\n
+    period.setShortTitle(\'%s-%s\' % (\n
+      date.strftime(\'%Y %m\'), (end_date - 1).strftime(\'%m\')))\n
   else:\n
     period.setShortTitle(date.strftime(\'%Y-%m\'))\n
     period.setTitle(str(translateString(date.strftime(\'%B\'))))\n
@@ -77,7 +85,7 @@ while date < context.getStopDate():\n
 \n
   date = end_date\n
   \n
-return context.Base_redirect(form_id, \n
+return context.Base_redirect(form_id,\n
      keep_items=dict(portal_status_message=translateString(\'Accounting periods created.\')))\n
 
 

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=43681&r1=43680&r2=43681&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Thu Feb 24 17:02:39 2011
@@ -1 +1 @@
-1453
\ No newline at end of file
+1454
\ No newline at end of file



More information about the Erp5-report mailing list