Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043201Openbravo ERPA. Platformpublic2020-02-12 16:552020-03-10 15:21
caristu 
caristu 
highminorhave not tried
closedfixed 
5
 
3.0PR20Q2 
alostale
Core
No
0043201: Wrong information displayed in the grid after editing a child record under some circumstances
Having a tab with an HQL where clause with dynamic variables, after editing a child record of that tab a DS request is fired to refresh the "parent" record.

In that case, the HQL where clause is not resolved properly because the context information is not being sent in the parent refresh request. This causes the parent record not to be updated properly and also the grid to show inconsistent information (because some extra request are also being fired, see attached image)

1) Apply the attached patch (hqlWhereClause.diff) which adds a "dynamic" HQL where clause into the "Imported Bank Statements" tab of the [Financial Account] window.
2) Run ant smartbuild -Dlocal=no
3) Go to the [Financial Account] window as F&B group admin
4) Select the "Caja" financial account
5) Switch to the "Imported Bank Statements" tab and create two records
6) Select one of the newly created bank statements and create a new record in the "Bank Statement Lines" for it. ERROR: The record is created but note that the parent tab is refreshed with wrong information. Also the selection is lost.
7) Refresh the "Imported bank Statements" tab to put the grid into a consistent state again
8) Edit the bank statement line created in step 6) and save. ERROR: the record is saved but note that the parent tab has been wrongly refreshed again.
a) Send the context information in the parent record refresh request so that the HQL where clause can be properly calculated
b) Do not try to resolve the HQL where clause when refreshing the parent record as filtering by ID should be enough
No tags attached.
png MultipleDSRequest.png (57,488) 2020-02-12 16:55
https://issues.openbravo.com/file_download.php?file_id=14030&type=bug
png

diff hqlWhereClause.diff (1,012) 2020-02-12 16:57
https://issues.openbravo.com/file_download.php?file_id=14031&type=bug
Issue History
2020-02-12 16:55caristuNew Issue
2020-02-12 16:55caristuAssigned To => platform
2020-02-12 16:55caristuFile Added: MultipleDSRequest.png
2020-02-12 16:55caristuModules => Core
2020-02-12 16:55caristuTriggers an Emergency Pack => No
2020-02-12 16:57caristuFile Added: hqlWhereClause.diff
2020-02-12 16:57caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=20363#r20363
2020-03-03 10:07caristuAssigned Toplatform => caristu
2020-03-03 10:07caristuReview Assigned To => alostale
2020-03-03 10:08caristuNote Added: 0118285
2020-03-06 14:59hgbotCheckin
2020-03-06 14:59hgbotNote Added: 0118404
2020-03-06 14:59hgbotStatusnew => resolved
2020-03-06 14:59hgbotResolutionopen => fixed
2020-03-06 14:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/eb2944131bb41e1cbb6a26111336028dce086f69 [^]
2020-03-10 15:21alostaleStatusresolved => closed
2020-03-10 15:21alostaleFixed in Version => 3.0PR20Q2

Notes
(0118285)
caristu   
2020-03-03 10:08   
MR: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/50 [^]
(0118404)
hgbot   
2020-03-06 14:59   
Repository: erp/devel/pi
Changeset: eb2944131bb41e1cbb6a26111336028dce086f69
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Feb 12 17:48:12 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/eb2944131bb41e1cbb6a26111336028dce086f69 [^]

fixes BUG-43201: Inconsistent grid state after editing a child record

  After editing a child record of a tab that has an HQL where clause
with dynamic variables, the request to refresh the parent record was not
working fine.

  This is because the HQL where clause could not be resolved because the
context information is not sent in this kind of request.

  But in this case we do not need to include the tab HQL where clause at
all, as we want to refresh just the record and that means that we are
going to filter by the record ID.

  Therefore, to fix this issue we are setting the _directNavigation and
_targetRecordId flags to avoid including additional filter clauses in
the request to the DefaultJSONDataService. Thus, in the request built to
refresh the current record we are now filtering just by the record ID.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
---