Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0055100Openbravo ERP00. Application dictionarypublic2024-04-04 22:092024-06-17 14:32
ivazquez 
Triage Platform Base 
highmajoralways
closedfixed 
5
pi 
PR24Q3 
approved
OBPS
Smartclient
94022
No
0055100: Abnormally execution of callouts in some windows
Problem in the back office when saving records, if the record is reloaded twice, some data is changed and the record is blocked, it seems to be related to the callouts referred to business partners.
1) Login in the live builds Openbravo backend.
2) Open the Sales Invoice window and create a new invoice using form mode, for example using the business partner "Hoteles Buenas Noches, S.A." and save the record.
3) Change the field "Payment terms" from "30 days" (as default to this business partner) to "Immediate" and save again the record
4) Without closing this window, execute 2 times the reload of them using the reload button.

You will see that the BP address disappears and the record remains as the record as if it were being edited.

This error is present in other windows such as Purchase Order, etc.

Video reproducing the error:

https://drive.google.com/file/d/1mShVLAfBUb1h66OKaQ4B-fWBQQ9ARx0w/view [^]

Also, I'll attach a video reproducing the error in the "Sales Invoice" window.

Reproduced in the latest version of Google Chrome.
No tags attached.
related to defect 0055101 closed Triage Platform Base Smarclient error when using CTRL+S shortcut to save a record 
? errorSmartclient24q.mp4 (2,002,491) 2024-04-04 22:09
https://issues.openbravo.com/file_download.php?file_id=19612&type=bug
? livebuilds.openbravo.com.har (1,063,211) 2024-04-10 15:49
https://issues.openbravo.com/file_download.php?file_id=19639&type=bug
gif error-callout-changed.gif (901,607) 2024-04-30 14:39
https://issues.openbravo.com/file_download.php?file_id=19735&type=bug
? errorSmartclient24qBPwithoutReload.mp4 (3,295,062) 2024-05-30 20:21
https://issues.openbravo.com/file_download.php?file_id=19836&type=bug
? errorSmartclient24qBPwithoutReload2.mp4 (2,080,548) 2024-05-30 20:21
https://issues.openbravo.com/file_download.php?file_id=19837&type=bug
Issue History
2024-04-04 22:09ivazquezNew Issue
2024-04-04 22:09ivazquezAssigned To => Triage Omni OMS
2024-04-04 22:09ivazquezFile Added: errorSmartclient24q.mp4
2024-04-04 22:09ivazquezOBNetwork customer => OBPS
2024-04-04 22:09ivazquezModules => Smartclient
2024-04-04 22:09ivazquezTriggers an Emergency Pack => No
2024-04-05 01:07ivazquezSupport ticket => 94022
2024-04-05 01:07ivazquezCategory01. General setup => 00. Application dictionary
2024-04-05 01:08ivazquezAssigned ToTriage Omni OMS => Triage Platform Base
2024-04-05 17:54ivazquezRelationship addedrelated to 0055101
2024-04-09 13:21AugustoMauchNote Added: 0162989
2024-04-09 13:21AugustoMauchStatusnew => feedback
2024-04-09 22:52ivazquezStatusfeedback => new
2024-04-09 22:52ivazquezSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=27793#r27793
2024-04-09 22:52ivazquezNote Added: 0163004
2024-04-10 08:59AugustoMauchNote Added: 0163007
2024-04-10 08:59AugustoMauchStatusnew => feedback
2024-04-10 15:49ivazquezFile Added: livebuilds.openbravo.com.har
2024-04-10 15:54ivazquezStatusfeedback => new
2024-04-10 15:58ivazquezNote Added: 0163060
2024-04-16 23:39ivazquezNote Added: 0163302
2024-04-17 09:47PracticsIssue Monitored: Practics
2024-04-26 20:13PracticsNote Added: 0163823
2024-04-30 14:39cbernerNote Added: 0163948
2024-04-30 14:39cbernerFile Added: error-callout-changed.gif
2024-05-02 15:19AugustoMauchStatusnew => acknowledged
2024-05-06 17:45AugustoMauchStatusacknowledged => scheduled
2024-05-06 23:12hgbotMerge Request Status => open
2024-05-06 23:12hgbotNote Added: 0164124
2024-05-30 20:20ivazquezNote Added: 0165356
2024-05-30 20:21ivazquezFile Added: errorSmartclient24qBPwithoutReload.mp4
2024-05-30 20:21ivazquezFile Added: errorSmartclient24qBPwithoutReload2.mp4
2024-06-17 14:27hgbotMerge Request Statusopen => approved
2024-06-17 14:32hgbotResolutionopen => fixed
2024-06-17 14:32hgbotStatusscheduled => closed
2024-06-17 14:32hgbotFixed in Version => PR24Q3
2024-06-17 14:32hgbotNote Added: 0166022
2024-06-17 14:32hgbotNote Added: 0166023

Notes
(0162989)
AugustoMauch   
2024-04-09 13:21   
Hello Ignacio,

I am not able to reproduce the issue in livebuilds, or in other environments. Can you recheck, please?
(0163004)
ivazquez   
2024-04-09 22:52   
Hello Augusto,

I was doing some tests and indeed the case in the Sales Order is no longer reproducible, but the problem in the Sales Invoice is still reproducible, can you check?

I will change the Steps to Reproduce, but you can see it reproduced in the video I attached to the issue with the name "errorSmartclient24q.mp4".
(0163007)
AugustoMauch   
2024-04-10 08:59   
Hello,

I still cannot reproduce it, but it is clear from your video that it is somehow reproducible. Let's do the following. Reproduce it with the developer tools open:
- Log in in Openbravo, open the Sales Invoice window
- Open the developer tools
- Click on the button to create a new record
- Click on the "Clear network log" button in the "Network" tab of the developer tools to start with a clean record log
- Reproduce the issue
- Click on the "Export HAR..." button in the developer tools. It will download a file, that I would like you to attach to this issue so that I can check what might be happening
(0163060)
ivazquez   
2024-04-10 15:58   
Hello Augusto,

I attached the .har file you requested, I hope it will help you to reproduce the error.

Another thing, I'm reproducing it in the latest version of Google Chrome, maybe this is why you can't reproduce it.

(123.0.6312.105)
(0163302)
ivazquez   
2024-04-16 23:39   
Hello Augusto,

Any news on this issue? Some partners have notified us that customers have some data inconsistency due to the same issue.

Regards,
Ignacio Vazquez
(0163823)
Practics   
2024-04-26 20:13   
Any news?
(0163948)
cberner   
2024-04-30 14:39   
Hello, I've been able to reproduce it consistently using Slow 3G throttle in developer tools. I've attached a gif to this issue.

I've also been doing some analysis on the provided .har file, it seems the problem is that in a slow environment we're somehow calling the FormInitializationComponent(FIC) with the CHANGE mode(as if we changed the business partner to nothing). This doesn't seem to happen if the environment is not slow(on the network side).

More analysis is required to find out why this is happening, will inform Augusto to keep looking with my findings.
(0164124)
hgbot   
2024-05-06 23:12   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1226 [^]
(0165356)
ivazquez   
2024-05-30 20:20   
Dear Augusto,

I will attach another video reproducing the error, which is not reloading the registry but exiting it and entering it again.
In one way of looking at it, it is the same as reloading the record, but this case that I show in the videos is how the client usually plays it without realizing it and when he saves the record is that the data is erroneous.

Regards,
Ignacio
(0166022)
hgbot   
2024-06-17 14:32   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 6f67af25de073428943339a203f7dae1a622b8ca
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 17-06-2024 12:30:13
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/6f67af25de073428943339a203f7dae1a622b8ca [^]

Fixes ISSUE-55100: Callouts are wrongly invoked after refreshing a record

The problem was that, sometimes, due to a race condition, a null value was set to c_bpartner_id after a refresh, that resulted in a
CHANGE request to the FIC that changed some values. Right after, the original c_bpartner_id value was reset, but the values modified
by the FIC remained modified.

The race conditions happens in some part of smartclient code that we were not able to debug (when smartclient was deployed in dev mode,
the issue could not be reproduced in the same way). The trigger for the change done by smartclient was this line [1], where the focus is
removed from a form item when a record is open in form view (or refreshed while in form view), to prevent a double-focus problem in firefox
(see [2]). After removing that line, the problem described in 55100 is no longer reproducible, and the problem described in [2] is not
reproducible either.

A better fix would have been to fix the root cause in smartclient (a form item being blurred should not result in the value of another item
being emptied), but given that it has not been possible to remove the root cause, the current fix seems to be good enough.

[1] https://gitlab.com/openbravo/product/openbravo/-/blob/d54fc216f43a800493d4bc58488ab9820a30d155/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js\#L285 [^]
[2] https://issues.openbravo.com/view.php\?id\=19248 [^]

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
(0166023)
hgbot   
2024-06-17 14:32   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1226 [^]