Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036457Openbravo ERPA. Platformpublic2017-07-11 13:032017-07-12 12:01
alostale 
alostale 
normalmajorhave not tried
closedfixed 
5
 
3.0PR17Q4 
AugustoMauch
Core
No
0036457: 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 clicked 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.
related to defect 0036454 closed alostale editing in grid record can be saved before callouts are applied 
depends on backport 00364693.0PR17Q3 closed alostale inconsistent grid state if cancelling changes before receiving FIC response 
related to defect 0036459 closed caristu error thrown when refreshing after cancelling row creation before FIC response is processed 
png Selection_192.png (64,610) 2017-07-11 13:04
https://issues.openbravo.com/file_download.php?file_id=10901&type=bug
png

png Selection_193.png (21,425) 2017-07-11 13:15
https://issues.openbravo.com/file_download.php?file_id=10902&type=bug
png
Issue History
2017-07-11 13:03alostaleNew Issue
2017-07-11 13:03alostaleAssigned To => platform
2017-07-11 13:03alostaleModules => Core
2017-07-11 13:03alostaleTriggers an Emergency Pack => No
2017-07-11 13:04alostaleFile Added: Selection_192.png
2017-07-11 13:14alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15482#r15482
2017-07-11 13:15alostaleFile Added: Selection_193.png
2017-07-11 13:15alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15483#r15483
2017-07-11 13:15alostaleRelationship addedrelated to 0036454
2017-07-11 13:17alostaleAssigned Toplatform => alostale
2017-07-11 13:33ngarciaIssue Monitored: ngarcia
2017-07-11 14:58alostaleRelationship addedrelated to 0036459
2017-07-12 08:18alostaleStatusnew => scheduled
2017-07-12 08:20hgbotCheckin
2017-07-12 08:20hgbotNote Added: 0098032
2017-07-12 08:20hgbotStatusscheduled => resolved
2017-07-12 08:20hgbotResolutionopen => fixed
2017-07-12 08:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5a4d53a0947fb4393d02af70ade0b4e911e88659 [^]
2017-07-12 08:34alostaleReview Assigned To => AugustoMauch
2017-07-12 10:11AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=15495#r15495
2017-07-12 12:01AugustoMauchNote Added: 0098043
2017-07-12 12:01AugustoMauchStatusresolved => closed
2017-07-12 12:01AugustoMauchFixed in Version => 3.0PR17Q4

Notes
(0098032)
hgbot   
2017-07-12 08:20   
Repository: erp/devel/pi
Changeset: 5a4d53a0947fb4393d02af70ade0b4e911e88659
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jul 11 13:29:02 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/5a4d53a0947fb4393d02af70ade0b4e911e88659 [^]

fixed 36457: 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
---
(0098043)
AugustoMauch   
2017-07-12 12:01   
Code reviewed and verified in pi@5a4d53a0947f