Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029172Openbravo ERPI. Performancepublic2015-03-06 13:372015-03-18 18:41
lorenzofidalgo 
umartirena 
normalmajorsometimes
closedfixed 
5
pi 
3.0PR15Q2 
Sandrahuguet
Google Chrome, Mozilla Firefox
Core
No
0029172: Clicking select all and after that unselect all records in AddPayment window induces browser to get stuck
If there is enough lines (I have tested this with 60 and 90 records and it has been successfully reproduced), clicking "select all" records and after that clicking same button (which is "unselect all" at that moment) induces browser to get stuck. [See screenshots].

I have tested this localhost and livebuilds in pi pgsql context.

[It is adviced to create as many puchase invoice records as possible with at least one product line each one and complete them to test this].

Login ERP using QAAdmin role.
Go to "Financial Account" window.
Select "Spain Cashbook" role.
Go to "Transaction" tab.
Create a new record.
Transaction Type: "BP Withdrawal".
Click "+" in Payment field to add a payment.
In "Add Payment" window:
--
Clear filters.
Click "select all" checkbox and next to that, click it again to "unselect all".
It will probably broke. If it does not, repeat "select all" + "unselect all" several times.
Performance
depends on backport 00292643.0PR15Q1.2 closed umartirena Clicking select all and after that unselect all records in AddPayment window induces browser to get stuck 
depends on backport 00292653.0PR14Q3.8 closed umartirena Clicking select all and after that unselect all records in AddPayment window induces browser to get stuck 
has duplicate defect 0029750 closed aferraz Performance problem in AddPaymentDisplayLogicActionHandler 
related to defect 0029314 closed AtulOpenbravo Clicking select all and after that unselect all records in Credit to Use grid in AddPayment window has performance issues 
jpg ScriptStopped.jpg (383,007) 2015-03-06 13:37
https://issues.openbravo.com/file_download.php?file_id=7860&type=bug
png SSCPI.png (296,038) 2015-03-06 13:39
https://issues.openbravo.com/file_download.php?file_id=7861&type=bug
png SSFFLH.png (196,363) 2015-03-06 13:40
https://issues.openbravo.com/file_download.php?file_id=7862&type=bug
png
Issue History
2015-03-06 13:37lorenzofidalgoNew Issue
2015-03-06 13:37lorenzofidalgoAssigned To => Sandrahuguet
2015-03-06 13:37lorenzofidalgoFile Added: ScriptStopped.jpg
2015-03-06 13:37lorenzofidalgoWeb browser => Google Chrome, Mozilla Firefox
2015-03-06 13:37lorenzofidalgoModules => Core
2015-03-06 13:37lorenzofidalgoTriggers an Emergency Pack => No
2015-03-06 13:39lorenzofidalgoWeb browserGoogle Chrome, Mozilla Firefox => Google Chrome, Mozilla Firefox
2015-03-06 13:39lorenzofidalgoDescription Updatedbug_revision_view_page.php?rev_id=7876#r7876
2015-03-06 13:39lorenzofidalgoFile Added: SSCPI.png
2015-03-06 13:40lorenzofidalgoFile Added: SSFFLH.png
2015-03-06 14:05jonalegriaesarteTag Attached: Performance
2015-03-06 14:47lorenzofidalgoWeb browserGoogle Chrome, Mozilla Firefox => Google Chrome, Mozilla Firefox
2015-03-06 14:47lorenzofidalgoSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7884#r7884
2015-03-06 15:58egoitzIssue Monitored: egoitz
2015-03-10 15:25SandrahuguetAssigned ToSandrahuguet => umartirena
2015-03-12 17:10SandrahuguetStatusnew => scheduled
2015-03-12 18:34hgbotCheckin
2015-03-12 18:34hgbotNote Added: 0075505
2015-03-12 18:34hgbotStatusscheduled => resolved
2015-03-12 18:34hgbotResolutionopen => fixed
2015-03-12 18:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ba035397bf8a35bc05d8cb7f522aa10d09f6f051 [^]
2015-03-13 03:18hudsonbotCheckin
2015-03-13 03:18hudsonbotNote Added: 0075516
2015-03-13 13:59SandrahuguetReview Assigned To => Sandrahuguet
2015-03-13 13:59SandrahuguetNote Added: 0075562
2015-03-13 13:59SandrahuguetStatusresolved => closed
2015-03-13 13:59SandrahuguetFixed in Version => 3.0PR15Q2
2015-03-17 12:58umartirenaRelationship addedrelated to 0029314
2015-03-18 09:19umartirenaNote Added: 0075715
2015-03-18 09:19umartirenaStatusclosed => new
2015-03-18 09:19umartirenaResolutionfixed => open
2015-03-18 09:19umartirenaFixed in Version3.0PR15Q2 =>
2015-03-18 17:17umartirenaNote Added: 0075746
2015-03-18 17:18umartirenaNote Edited: 0075746bug_revision_view_page.php?bugnote_id=0075746#r8028
2015-03-18 18:40SandrahuguetStatusnew => scheduled
2015-03-18 18:41SandrahuguetStatusscheduled => resolved
2015-03-18 18:41SandrahuguetResolutionopen => fixed
2015-03-18 18:41umartirenaStatusresolved => scheduled
2015-03-18 18:41umartirenaStatusscheduled => resolved
2015-03-18 18:41umartirenaFixed in Version => pi
2015-03-18 18:41SandrahuguetNote Added: 0075752
2015-03-18 18:41SandrahuguetStatusresolved => closed
2015-03-18 18:41SandrahuguetFixed in Versionpi => 3.0PR15Q2
2015-05-22 14:18aferrazRelationship addedhas duplicate 0029750

Notes
(0075505)
hgbot   
2015-03-12 18:34   
Repository: erp/devel/pi
Changeset: ba035397bf8a35bc05d8cb7f522aa10d09f6f051
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Mon Mar 09 18:58:14 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/ba035397bf8a35bc05d8cb7f522aa10d09f6f051 [^]

Fixes bug 29172: Improved performance select/deselect all records in OrderInv grid

The problem was that on every selection/deselection of a record in Order Invoices grid it was triggering the execution of these three methods: 'OB.APRM.AddPayment.updateInvOrderTotal(view.theForm, orderInvoice), OB.APRM.AddPayment.updateActualExpected(view.theForm), OB.APRM.AddPayment.updateDifference(view.theForm)'.
Actually it is not necessary to execute these functions on every record, because in the end they are updating total values, so just executing them after the iteration of the last record selected/deselected it would be enough.
To implement this, 'userSelectAllRecords' and 'deselectAllRecords' ListGrid methods have been overriden, to set a flag to true, in order to know when a record is changed while clicking selected/deselect all records, and in this case the three methods will be executed in the last record of the grid.
The 'OB.APRM.AddPayment.userSelectAllRecords' is executed only when clicking in select all records checkbox, but 'OB.APRM.AddPayment.deselectAllRecords' is executed while unchecking the previous checkbox and when fetching data in the grid using 'invalidateCache()' method. In this last case these functions will not be executed on every deselection neither in the last record, because they are already invoked directly in 'invalidateCache()', so in this case they will be avoided.

---
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
---
(0075516)
hudsonbot   
2015-03-13 03:18   
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/6f599d5217c4 [^]
Maturity status: Test
(0075562)
Sandrahuguet   
2015-03-13 13:59   
Code review + testing OK
(0075715)
umartirena   
2015-03-18 09:19   
Reopened because it does not update differences after reload of Order Invoices grid
(0075746)
umartirena   
2015-03-18 17:17   
(edited on: 2015-03-18 17:18)
Repository: erp/devel/pi
Changeset: f400d595dc526125619530f0d8a725190cece3d1
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Tue Mar 17 20:08:08 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f400d595dc526125619530f0d8a725190cece3d1 [^]

Related to bug 29172: Delete obaprmAllRecordsSelectedByUser in OrderInvoice Load

While executing invalidateCache() function to reload OrderInvoice grid it internally calls to 'OB.APRM.AddPayment.deselectAllRecords' overriden method that sets obaprmAllRecordsSelectedByUser property to true. This property is only needed when manually the select/unselect all checkbox is clicked.

This was causing on certain scenarios that methods to update totals were not being called:
* OB.APRM.AddPayment.updateInvOrderTotal(view.theForm, orderInvoice);
* OB.APRM.AddPayment.updateActualExpected(view.theForm);
* OB.APRM.AddPayment.updateDifference(view.theForm);

So, in order to avoid this in OrderInvoiceOnLoad function, if the property 'obaprmAllRecordsSelectedByUser' exists, it will be deleted.

---
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
---

(0075752)
Sandrahuguet   
2015-03-18 18:41   
Code review + testing OK