Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0017821Openbravo ERP01. General setuppublic2011-06-29 14:482012-04-01 20:37
roklenardic 
alostale 
normalminoralways
closedfixed 
5
pi 
3.0MP10 
Google Chrome
Core
No
0017821: Rearranging menu items takes abnormal amount of time
Rearranging menu items takes abnormal amount of time
1) Switch to the System Admin role
2) create a template or check the Customizations Allowed checkbox
3) go to General setup || Application || Menu
4) move any item around

The time it takes for the success message to appear is really long and the user does not know what is going on. Often it happens they start moving another item around, potentially corrupting the menu structure.
No tags attached.
png Selection_036.png (8,284) 2012-03-01 12:05
https://issues.openbravo.com/file_download.php?file_id=5044&type=bug
png

png Selection_037.png (6,685) 2012-03-01 12:05
https://issues.openbravo.com/file_download.php?file_id=5045&type=bug
png

? 17821.export (1,323) 2012-03-01 12:35
https://issues.openbravo.com/file_download.php?file_id=5047&type=bug
Issue History
2011-06-29 14:48roklenardicNew Issue
2011-06-29 14:48roklenardicAssigned To => dalsasua
2011-06-29 14:48roklenardicWeb browser => Google Chrome
2011-06-29 14:48roklenardicModules => Core
2011-07-20 18:09dalsasuaAssigned Todalsasua => jonalegriaesarte
2012-02-15 19:05iciordiaAssigned Tojonalegriaesarte => vmromanos
2012-02-16 14:01vmromanosAssigned Tovmromanos => alostale
2012-02-29 13:19malsasuaWeb browserGoogle Chrome => Google Chrome
2012-02-29 15:16alostaleWeb browserGoogle Chrome => Google Chrome
2012-02-29 15:16alostaleTarget Version => 3.0MP10
2012-02-29 15:16alostaleStatusnew => scheduled
2012-02-29 15:16alostalefix_in_branch => pi
2012-03-01 12:05alostaleFile Added: Selection_036.png
2012-03-01 12:05alostaleFile Added: Selection_037.png
2012-03-01 12:09alostaleNote Added: 0045658
2012-03-01 12:18alostaleNote Added: 0045660
2012-03-01 12:35alostaleFile Added: 17821.export
2012-03-01 12:35alostaleNote Added: 0045662
2012-03-06 08:45hgbotCheckin
2012-03-06 08:45hgbotNote Added: 0046065
2012-03-06 08:45hgbotStatusscheduled => resolved
2012-03-06 08:45hgbotResolutionopen => fixed
2012-03-06 08:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9644db90eb375b62a0680acf6ca8112471b80201 [^]
2012-03-16 15:54marvintmStatusresolved => closed
2012-04-01 20:37hudsonbotCheckin
2012-04-01 20:37hudsonbotNote Added: 0047040

Notes
(0045658)
alostale   
2012-03-01 12:09   
The problem is WindowTree call is spending a lot of time (in attached Selection_036.png is 2.34s).

Concretely, the time consuming part is checking possible tree cycles by ad_parent_tree pl function.

This function exits recusivity only when exception occurs, the solution is not to wait for exception to occur but correctly exit by detecting the case that would raise exception.
(0045660)
alostale   
2012-03-01 12:18   
After applying the fix the time is reduced to 21ms.

There is no regression risk on this fix because it is changing the implementation of ad_parent_tree but returning the same result.

Test plan:

* To ensure the current result of ad_parent_tree is the same as it was before:
  -create a db function (ad_parent_tree_orig) as it was previously to the fix.
  -compare results of new and old function for all menu entries, the result of this query should be 0:
      select count(*)
        from (select node_id from ad_treenode where ad_tree_id ='10') a
       where ad_parent_tree('10', node_id) != ad_parent_tree_orig('10', node_id)
(0045662)
alostale   
2012-03-01 12:35   
Attached export as pi is currently frozen for mp9
(0046065)
hgbot   
2012-03-06 08:45   
Repository: erp/devel/pi
Changeset: 9644db90eb375b62a0680acf6ca8112471b80201
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Mar 01 12:34:27 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9644db90eb375b62a0680acf6ca8112471b80201 [^]

fixed bug 17821: Improved performance in ad_parent_tree function

Proper exit recursivity instead of waiting for an exception to be thrown

---
M src-db/database/model/functions/AD_PARENT_TREE.xml
---
(0047040)
hudsonbot   
2012-04-01 20:37   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/640de9acc2d5 [^]

Maturity status: Test