Discussion:
[Erp5-dev] [Erp5-report] r17867 - /erp5/trunk/products/ERP5Type/patches/sqlvar.py
bartek
2008-01-02 14:09:24 UTC
Permalink
Hi

I have a problem with this change - when it is applied, activities are
not executed. On the HEAD version with this one reverted everything
works fine. From what I found out, it is because the value of "now"
supplied by activity tool to sql methods is being converted to UTC,
which means 1 hour is subtracted (my machine is set to GMT+1), in effect
the activity tool executes only messages which are older then one hour :)

Has this patch been tested on a machine using timezone other then GMT?

Bartek
Author: ivan
Date: Wed Nov 28 15:17:14 2007
New Revision: 17867
URL: http://svn.erp5.org?rev=17867&view=rev
Convert explicitly DateTime values to UTC.
erp5/trunk/products/ERP5Type/patches/sqlvar.py
Modified: erp5/trunk/products/ERP5Type/patches/sqlvar.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/sqlvar.py?rev=17867&r1=17866&r2=17867&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/sqlvar.py (original)
+++ erp5/trunk/products/ERP5Type/patches/sqlvar.py Wed Nov 28 15:17:14 2007
@@ -19,6 +19,7 @@
from string import atoi,atof
from types import StringType
from Products.ERP5Type.PsycoWrapper import psyco
+from DateTime import DateTime
name=self.__name__
@@ -70,17 +71,15 @@
- v=v.ISO()
- v=v.strftime('%Y-%m-%d %H:%M:%S')
- v=str(v)
+ v=v.toZone('UTC').ISO()
+ v = DateTime(v)
+ v=v.toZone('UTC').ISO()
return 'null'
raise ValueError, (
'Invalid datetime value for <em>%s</em>: %r' % (name, v))
-
v=md.getitem('sql_quote__',0)(v)
# End of patch
_______________________________________________
Erp5-report mailing list
Erp5-report at erp5.org
http://mail.nexedi.com/mailman/listinfo/erp5-report
--
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"
Ivan Tyagov
2008-01-02 15:25:42 UTC
Permalink
Hi,
Post by bartek
Hi
I have a problem with this change - when it is applied, activities are
not executed. On the HEAD version with this one reverted everything
works fine. From what I found out, it is because the value of "now"
supplied by activity tool to sql methods is being converted to UTC,
which means 1 hour is subtracted (my machine is set to GMT+1), in effect
the activity tool executes only messages which are older then one hour :)
Did you update CMFActivity as well ?
Post by bartek
Has this patch been tested on a machine using timezone other then GMT?
Yes, GTM+2. it works as expected as well all other test suites regarding
activities.

Regards
Ivan
Post by bartek
Bartek
Author: ivan
Date: Wed Nov 28 15:17:14 2007
New Revision: 17867
URL: http://svn.erp5.org?rev=17867&view=rev
Convert explicitly DateTime values to UTC.
erp5/trunk/products/ERP5Type/patches/sqlvar.py
Modified: erp5/trunk/products/ERP5Type/patches/sqlvar.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/sqlvar.py?rev=17867&r1=17866&r2=17867&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/sqlvar.py (original)
+++ erp5/trunk/products/ERP5Type/patches/sqlvar.py Wed Nov 28 15:17:14 2007
@@ -19,6 +19,7 @@
from string import atoi,atof
from types import StringType
from Products.ERP5Type.PsycoWrapper import psyco
+from DateTime import DateTime
name=self.__name__
@@ -70,17 +71,15 @@
- v=v.ISO()
- v=v.strftime('%Y-%m-%d %H:%M:%S')
- v=str(v)
+ v=v.toZone('UTC').ISO()
+ v = DateTime(v)
+ v=v.toZone('UTC').ISO()
return 'null'
raise ValueError, (
'Invalid datetime value for <em>%s</em>: %r' % (name, v))
-
v=md.getitem('sql_quote__',0)(v)
# End of patch
_______________________________________________
Erp5-report mailing list
Erp5-report at erp5.org
http://mail.nexedi.com/mailman/listinfo/erp5-report
--
Ivan Tyagov
ERP5 Enterprise: Free / Open Source ERP for Critical Applications
http://www.erp5.com
ERP5 Express: Hosted Open Source ERP for small companies
http://www.myerp5.com
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
bartek
2008-01-02 15:37:01 UTC
Permalink
Post by Ivan Tyagov
Hi,
Post by bartek
Hi
I have a problem with this change - when it is applied, activities are
not executed. On the HEAD version with this one reverted everything
works fine. From what I found out, it is because the value of "now"
supplied by activity tool to sql methods is being converted to UTC,
which means 1 hour is subtracted (my machine is set to GMT+1), in effect
the activity tool executes only messages which are older then one hour :)
Did you update CMFActivity as well ?
Yes, everything is r18569.
Post by Ivan Tyagov
Post by bartek
Has this patch been tested on a machine using timezone other then GMT?
Yes, GTM+2. it works as expected as well all other test suites regarding
activities.
Doesn't work for me, though. Maybe it hits only older sites which are
being upgraded? Do you want some debugging info?

Bartek
Post by Ivan Tyagov
Regards
Ivan
Post by bartek
Bartek
Author: ivan
Date: Wed Nov 28 15:17:14 2007
New Revision: 17867
URL: http://svn.erp5.org?rev=17867&view=rev
Convert explicitly DateTime values to UTC.
erp5/trunk/products/ERP5Type/patches/sqlvar.py
Modified: erp5/trunk/products/ERP5Type/patches/sqlvar.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/sqlvar.py?rev=17867&r1=17866&r2=17867&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/sqlvar.py (original)
+++ erp5/trunk/products/ERP5Type/patches/sqlvar.py Wed Nov 28 15:17:14 2007
@@ -19,6 +19,7 @@
from string import atoi,atof
from types import StringType
from Products.ERP5Type.PsycoWrapper import psyco
+from DateTime import DateTime
name=self.__name__
@@ -70,17 +71,15 @@
- v=v.ISO()
- v=v.strftime('%Y-%m-%d %H:%M:%S')
- v=str(v)
+ v=v.toZone('UTC').ISO()
+ v = DateTime(v)
+ v=v.toZone('UTC').ISO()
return 'null'
raise ValueError, (
'Invalid datetime value for <em>%s</em>: %r' % (name, v))
-
v=md.getitem('sql_quote__',0)(v)
# End of patch
_______________________________________________
Erp5-report mailing list
Erp5-report at erp5.org
http://mail.nexedi.com/mailman/listinfo/erp5-report
--
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"
Ivan Tyagov
2008-01-02 16:25:42 UTC
Permalink
Post by bartek
Post by Ivan Tyagov
Post by bartek
Has this patch been tested on a machine using timezone other then GMT?
Yes, GTM+2. it works as expected as well all other test suites regarding
activities.
Doesn't work for me, though. Maybe it hits only older sites which are
being upgraded? Do you want some debugging info?
Yes, I could use it.

Ivan

Loading...