Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033853Openbravo ERPA. Platformpublic2016-08-30 10:582016-12-23 08:15
alostale 
NaroaIriarte 
highminorhave not tried
closedfixed 
5
 
3.0PR17Q1 
alostale
Core
No
0033853: summary functions: extra DS requests when relocating grid column
If a grid has at least a column with a summary function, when any column is relocated to another position, 3 DS requests to calculate summary function values are triggered.
1. Open Sales Order window
2. Add a summary function on any column
3. Drag any column to a different position
   -> Check 3 DS requests are executed
Performance
related to defect 0033588 closed caristu Datasource Request done having a summary function with lazy filtering enabled 
related to defect 0033626 closed NaroaIriarte Unneeded datasource request after cancelling a newly created record in grid view having summary functions 
Issue History
2016-08-30 10:58alostaleNew Issue
2016-08-30 10:58alostaleAssigned To => platform
2016-08-30 10:58alostaleModules => Core
2016-08-30 10:58alostaleTriggers an Emergency Pack => No
2016-08-30 10:58alostaleTag Attached: Performance
2016-08-30 10:58alostaleRelationship addedrelated to 0033588
2016-08-30 10:59alostaleStatusnew => acknowledged
2016-08-30 14:00caristuRelationship addedrelated to 0033626
2016-12-01 13:20alostalePriorityurgent => normal
2016-12-01 14:05alostalePrioritynormal => urgent
2016-12-01 14:05alostalePriorityurgent => high
2016-12-02 09:00NaroaIriarteAssigned Toplatform => NaroaIriarte
2016-12-02 09:32NaroaIriarteStatusacknowledged => scheduled
2016-12-14 12:52NaroaIriarteReview Assigned To => alostale
2016-12-14 12:53hgbotCheckin
2016-12-14 12:53hgbotNote Added: 0092349
2016-12-14 12:53hgbotStatusscheduled => resolved
2016-12-14 12:53hgbotResolutionopen => fixed
2016-12-14 12:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bb721685f50aa502095c9b8be09f66595b8d9106 [^]
2016-12-16 08:38alostaleNote Added: 0092431
2016-12-16 08:38alostaleStatusresolved => new
2016-12-16 08:38alostaleResolutionfixed => open
2016-12-16 08:48alostaleNote Edited: 0092431bug_revision_view_page.php?bugnote_id=0092431#r14016
2016-12-16 10:43hgbotCheckin
2016-12-16 10:43hgbotNote Added: 0092467
2016-12-16 10:54NaroaIriarteStatusnew => scheduled
2016-12-16 10:54NaroaIriarteStatusscheduled => resolved
2016-12-16 10:54NaroaIriarteResolutionopen => fixed
2016-12-16 18:39hudsonbotCheckin
2016-12-16 18:39hudsonbotNote Added: 0092711
2016-12-16 18:39hudsonbotCheckin
2016-12-16 18:39hudsonbotNote Added: 0092725
2016-12-23 08:15alostaleNote Added: 0092955
2016-12-23 08:15alostaleStatusresolved => closed
2016-12-23 08:15alostaleFixed in Version => 3.0PR17Q1

Notes
(0092349)
hgbot   
2016-12-14 12:53   
Repository: erp/devel/pi
Changeset: bb721685f50aa502095c9b8be09f66595b8d9106
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Mon Dec 12 16:10:29 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bb721685f50aa502095c9b8be09f66595b8d9106 [^]

Fixed issue 33853: There were too much DS request

When a column with a summary function was set, if any of the grid columns was reordered, there were three DS requests triggered. To fix the problem two different things have been done. The first, in ob-view-grid.js, consists on setting the showGridSummary property to false before the call to the function "reorderField" of the Super- This avoids one flow of smartclient which was, at the end, triggering two DS requests.
The second approach is also in ob-view-grid, but also in ob-grid. The problem was that when the ob-grid.getSummaryRow function was invoked, the return statement was calling the "getSummaryRow" function of the Super. There, once again a DS request was triggered. To fix this, a new object has been created. This object contains three properties. One of them is a property which is true if the columns have been reordered.
Now, in the ob-grid.getSummaryRow, if that property is true and if there is a summary function, the summary row is returned.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0092431)
alostale   
2016-12-16 08:38   
(edited on: 2016-12-16 08:48)
reopening:

A. Incorrect behavior
1. Open a window without any summary function
2. Move any column in grid to another position
  -> ERROR: Summary function row appears with "no items to show" message

B. Code review
ob-view-grid.js, ln 986
All the variables in a function must be declared on top of the function: http://wiki.openbravo.com/wiki/JavaScript_Coding_Conventions#Variable_Declaration [^]


https://docs.google.com/spreadsheets/d/18l2biKWeG6iGDIPqO6VuYQ_TtP_6YxyQU4KSrPvQlJ8/edit#gid=0 [^]

(0092467)
hgbot   
2016-12-16 10:43   
Repository: erp/devel/pi
Changeset: a5d7d303b6c2b96bee3f652c918d83909bde3d92
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Fri Dec 16 10:33:06 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a5d7d303b6c2b96bee3f652c918d83909bde3d92 [^]

Related to issue 33853: Code review improvements

In js variables must be declared at the top of the function.
Also there were problems when reordering if there was not a summary function declared. This has been prevented with an if statement. A new function has been created, this, handles the behavior of the summary functions' grid when it is necessary.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0092711)
hudsonbot   
2016-12-16 18:39   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092725)
hudsonbot   
2016-12-16 18:39   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092955)
alostale   
2016-12-23 08:15   
code reviewed

tested:

1. no extra request when relocating columns having summary functions in grid
2. working fine when relocating columns without summary functions