Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029314Openbravo ERP09. Financial managementpublic2015-03-17 12:582018-12-11 20:22
umartirena 
AtulOpenbravo 
normalmajoralways
closedfixed 
5
 
3.0PR19Q1 
Sandrahuguet
Core
No
0029314: Clicking select all and after that unselect all records in Credit to Use grid in AddPayment window has performance issues
Having an amount of lines in Credit to Use between 60 and 90 and clicking on select/unselect all causes performance issues.
Create an amount of Credit Payments between 60 and 90 for a certain business partner.

As F&B Admin:
* Go to Payment In window.
* Create a header and press Add Details.
* Click on select all checkbox. Realize that takes long, if it finishes.
Implement a solution similar to the one in this issue: https://issues.openbravo.com/view.php?id=29172 [^]
Performance
related to defect 0029172 closed umartirena Clicking select all and after that unselect all records in AddPayment window induces browser to get stuck 
Issue History
2015-03-17 12:58umartirenaNew Issue
2015-03-17 12:58umartirenaAssigned To => Sandrahuguet
2015-03-17 12:58umartirenaModules => Core
2015-03-17 12:58umartirenaTriggers an Emergency Pack => No
2015-03-17 12:58umartirenaRelationship addedrelated to 0029172
2015-03-17 12:59umartirenaTag Attached: Performance
2015-03-17 17:49umartirenaAssigned ToSandrahuguet => umartirena
2015-07-21 08:31AtulOpenbravoAssigned Toumartirena => AtulOpenbravo
2015-07-21 08:31AtulOpenbravoStatusnew => scheduled
2015-07-22 10:27AtulOpenbravoNote Added: 0079022
2018-11-19 12:30hgbotCheckin
2018-11-19 12:30hgbotNote Added: 0107976
2018-11-19 12:30hgbotStatusscheduled => resolved
2018-11-19 12:30hgbotResolutionopen => fixed
2018-11-19 12:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0c740ea713132252980f8723a36f766da1995006 [^]
2018-11-19 12:30hgbotCheckin
2018-11-19 12:30hgbotNote Added: 0107977
2018-11-19 12:32SandrahuguetReview Assigned To => Sandrahuguet
2018-11-19 12:32SandrahuguetNote Added: 0107978
2018-11-19 12:32SandrahuguetStatusresolved => closed
2018-11-19 12:32SandrahuguetFixed in Version => 3.0PR19Q1
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108473
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108474

Notes
(0079022)
AtulOpenbravo   
2015-07-22 10:27   
Test Plan
- Login as F&B Admin.
- Create around 60 to 90 Credit Payments for any business partner using Payment In window.

Credit Payment

- In Payment In window, select organization, business partner, enter amount.
  For eg:- user business partner "Hoteles Buenas Noches, S.A.".
- Click on add details, Make sure that there is no record selected in Invoice/Order grid, Credit Grid, no entry in G/LItem grid.
- Choose action regarding document as "Process Received Payment(s) and Deposit" and Over Payment Action as "Leave the credit to be used later" and click on done process.
- In this way create 60 - 90 credit payment records in Payment In.

Payment In which uses all previous created credit payments.

- In Payment In window, select organization, business partner as used in credit payment save record.
- Click on add details, In the Credit to User grid Click on select all checkbox. - Realize that it is faster as compare to previous.
- Unselect all check box and check that it is faster as compare to previous.
(0107976)
hgbot   
2018-11-19 12:30   
Repository: erp/devel/pi
Changeset: 0c740ea713132252980f8723a36f766da1995006
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Jul 22 10:25:06 2015 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/0c740ea713132252980f8723a36f766da1995006 [^]

Fixes Issue 29314:Clicking select all and after that unselect all records in
Credit to Use grid in AddPayment window has performance issues

The problem was that on every selection/deselection of record in creditUseGrid
it was triggering the execution of these three methods:
* OB.APRM.AddPayment.updateCreditTotal(view.theForm);
* OB.APRM.AddPayment.updateActualExpected(view.theForm);
* OB.APRM.AddPayment.distributeAmount(view, view.theForm, true);

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.

While executing invalidateCache() function to reload CreditUse 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.In order
to avoid this in creditOnLoadGrid function, if the property
'obaprmAllRecordsSelectedByUser' exists, it will be deleted.

---
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
---
(0107977)
hgbot   
2018-11-19 12:30   
Repository: erp/devel/pi
Changeset: b08cf6ab13a4c5d26d68448a1bf5b05aa735357d
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Mon Nov 19 12:28:51 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b08cf6ab13a4c5d26d68448a1bf5b05aa735357d [^]

related to issue 29314 code review: apply formatting

---
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
---
(0107978)
Sandrahuguet   
2018-11-19 12:32   
Code review + testing OK
(0108473)
hudsonbot   
2018-12-11 20:22   
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/470e3cd384c5 [^]
Maturity status: Test
(0108474)
hudsonbot   
2018-12-11 20:22   
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/470e3cd384c5 [^]
Maturity status: Test