Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033618Openbravo ERPA. Platformpublic2016-08-03 15:222016-08-30 10:50
caristu 
caristu 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q4 
alostale
Core
No
0033618: Unneeded datasource requests after creating a new record in grid view having summary functions
Having a grid with a summary function, if we create a new record in grid view, multiple (not needed) datasource requests are fired.
1) Go to the [Unit of Measure] window
2) Add a summary field in any column
3) Create a new record in grid view and check that multiple datasource requests are fired
Performance
related to defect 0033588 closed caristu Datasource Request done having a summary function with lazy filtering enabled 
related to defect 00256213.0PR14Q3 closed guillermogil Summary function fields are not working fine 
related to defect 00263633.0PR14Q3 closed guillermogil Summary function fields are not working fine when you create a record in grid view 
related to defect 0033626 closed NaroaIriarte Unneeded datasource request after cancelling a newly created record in grid view having summary functions 
related to defect 0033669 closed caristu Unneeded datasource request after opening a window with a summary function on a child tab 
Issue History
2016-08-03 15:22caristuNew Issue
2016-08-03 15:22caristuAssigned To => platform
2016-08-03 15:22caristuModules => Core
2016-08-03 15:22caristuTriggers an Emergency Pack => No
2016-08-03 15:22caristuTag Attached: Performance
2016-08-03 15:22caristuRelationship addedrelated to 0033588
2016-08-04 09:21caristuAssigned Toplatform => caristu
2016-08-04 09:22caristuStatusnew => scheduled
2016-08-04 14:55caristuRelationship addedrelated to 0025621
2016-08-04 14:55caristuRelationship addedrelated to 0026363
2016-08-04 15:27hgbotCheckin
2016-08-04 15:27hgbotNote Added: 0088821
2016-08-04 15:27hgbotStatusscheduled => resolved
2016-08-04 15:27hgbotResolutionopen => fixed
2016-08-04 15:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/12e245f1bfeaa36650801918365d0f04cb70be2c [^]
2016-08-04 15:27caristuReview Assigned To => alostale
2016-08-04 15:30caristuRelationship addedrelated to 0033626
2016-08-10 10:28caristuRelationship addedrelated to 0033669
2016-08-11 18:40hudsonbotCheckin
2016-08-11 18:40hudsonbotNote Added: 0089039
2016-08-30 10:50alostaleNote Added: 0089538
2016-08-30 10:50alostaleStatusresolved => closed
2016-08-30 10:50alostaleFixed in Version => 3.0PR16Q4

Notes
(0088821)
hgbot   
2016-08-04 15:27   
Repository: erp/devel/pi
Changeset: 12e245f1bfeaa36650801918365d0f04cb70be2c
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Aug 04 15:18:01 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/12e245f1bfeaa36650801918365d0f04cb70be2c [^]

fixes issue 33618: Unneeded datasource requests having summary functions
After editing a record in grid view, having summary functions, several DS request were fired. This was happening when processing the FIC return: setting the values for each field was causing a datasource call for refreshing the summaries, because Smartclient detected that the grid summary record was displayed. This wrong behavior also affected when editing manually the fields in grid view.
To fix this problem, if the summary record is displayed, we prevent those calls by setting the showGridSummary property of the grid to false, therefore Smartclient will not fire those unneeded requests. And once the edit function has finished we restore the value.

Together with this, there were some additional requests being fired when saving/updating a record in grid view. This was happening because the getSummaryRow() was being used to refresh the summaries but at the same time, the dataChanged function of the grid was indeed doing the same.
To solve this second problem, we just invoke getSummaryRow() when saving a new record in grid view, because this is the only case where the dataChanged function was not firing the request for refreshing the summaries.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0089039)
hudsonbot   
2016-08-11 18:40   
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/edaa05b1fb18 [^]
Maturity status: Test
(0089538)
alostale   
2016-08-30 10:50   
code reviewed

Tested after new record creation in grid a single request to calculate summary functions is performed and the values get properly updated.