← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 511248] Re: another obvious speed fix in web client

 

*** This bug is a duplicate of bug 511221 ***
    https://bugs.launchpad.net/bugs/511221

** Changed in: openobject-client-web
       Status: Fix Committed => Fix Released

** This bug has been marked a duplicate of bug 511221
   trivial speed enhancement in web client?
 * You can subscribe to bug 511221 by following this link: https://bugs.launchpad.net/openobject-client-web/+bug/511221/+subscribe

-- 
another obvious speed fix in web client
https://bugs.launchpad.net/bugs/511248
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Web Client: Fix Released

Bug description:
The datetime widget uses getElementsByAttribute, which is very slow, whereas it could easily use getElementById, which is fast.
The following 2-line patch improves and simplifies the widget javascript:

=== modified file 'openerp/widgets/templates/datetime.mako'
--- openerp/widgets/templates/datetime.mako	2009-08-18 11:08:32 +0000
+++ openerp/widgets/templates/datetime.mako	2010-01-22 16:04:56 +0000
@@ -16,12 +16,9 @@
             
             <script type="text/javascript">
             
-                var dt_field = getElementsByAttribute(['id', '${name}']);
-                var dt_button = getElementsByAttribute(['id', '${name}_trigger']);
+                var dt_field = document.getElementById('${name}');
+                var dt_button = document.getElementById('${name}_trigger');
                 
-                dt_field = dt_field[dt_field.length-1];
-                dt_button = dt_button[dt_button.length-1];
-            
                 Calendar.setup(
                 {
                     inputField : dt_field,