Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036469Openbravo ERPA. Platformpublic2017-07-11 13:032017-07-13 18:10
alostale 
alostale 
normalmajorhave not tried
closedfixed 
5
 
3.0PR17Q33.0PR17Q3 
AugustoMauch
Core
No
0036469: inconsistent grid state if cancelling changes before receiving FIC response
When editing in grid mode, it is possible to reach to an inconsistent state if cancel changes button is clicking while a FIC request has done but it has not been yet processed. This is easier to reproduce in case of long FIC requests due either slow network or performance issues in callouts implementation.
* case 1
  1.1. Add artificial delay in SL_Order_Product callout code: Thread.sleep(5_000L);
  1.2. Create a Sales Quotation header
  1.2. Insert Row in grid mode
  1.3. Select a product
  1.4. Before callout response is received click on cancel changes button
    -> When callout response is received and processed a new incorrect line is created with only few fields populated (see attached image 192)

* case 2
  2.1. Add artificial delay in SL_Order_Product callout code: Thread.sleep(5_000L);
  2.2. Insert two lines both with Agua sin Gas as product (check price is 1.53 for them)
  2.3. Select 1st line
  2.4. Click on new in grid -> check new row is created between 1st and 2nd
  2.5. Select Cerveza as product
  2.6. Before callout response is received, cancel changes and edit 2nd row
     -> Check price is changed from 1.53 to 2.04: when callout response is received and processed values from cancelled edition are wrongly applied to current record.
No tags attached.
blocks defect 0036457 closed alostale inconsistent grid state if cancelling changes before receiving FIC response 
Issue History
2017-07-12 08:18alostaleTypedefect => backport
2017-07-12 08:18alostaleTarget Version => 3.0PR17Q3
2017-07-12 08:34alostaleReview Assigned To => AugustoMauch
2017-07-12 09:04hgbotCheckin
2017-07-12 09:04hgbotNote Added: 0098034
2017-07-12 09:04hgbotStatusscheduled => resolved
2017-07-12 09:04hgbotResolutionopen => fixed
2017-07-12 09:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR17Q3/rev/589094b8635e81a02187f01fed99cebf16c4297c [^]
2017-07-13 18:10AugustoMauchNote Added: 0098069
2017-07-13 18:10AugustoMauchStatusresolved => closed
2017-07-13 18:10AugustoMauchFixed in Version => 3.0PR17Q3

Notes
(0098034)
hgbot   
2017-07-12 09:04   
Repository: erp/backports/3.0PR17Q3
Changeset: 589094b8635e81a02187f01fed99cebf16c4297c
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jul 11 13:29:02 2017 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR17Q3/rev/589094b8635e81a02187f01fed99cebf16c4297c [^]

fixed 36469: inconsistent grid state if cancelling changes before FIC response

  If while editing in grid mode, changes are cancelled before receiving FIC
  response, it was possible to:
   - Create a new partial and incorrect line with only the data returned from
     FIC in case no line was being edited
   - Apply changes from FIC to incorrect row if another one was being edited

  Both problems are fixed by applying FIC changes only if the record is the same
  the request was triggered for, this is checked by ensuring both row number and
  record id. If editin a different record, FIC response is simply ignored.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
(0098069)
AugustoMauch   
2017-07-13 18:10   
Code reviewed and verified