Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037465Openbravo ERPA. Platformpublic2017-12-12 18:062018-01-03 23:03
vmromanos 
caristu 
normalmajoralways
closedfixed 
5
 
3.0PR18Q1 
alostale
Core
No
0037465: Same process definition in several tabs in same window sends wrong information to server
I have defined a window with a header and 2 tabs at the same level:

Header
Tab1 Tab2

An existing equivalent would be:
SalesOrder
Lines BasicDiscounts



Tab1 and Tab2 has associated the same Process Definition.
When a record is selected either in Tab1 or Tab2, the process definition detects:
 1. from which tab it has been called (through the "inpTabId" parameter)
 2. what is the key column name (through either "inpKeyName" or "keyColumnName" parameters)
 3. and what is the record id the user has selected to run the process (getting the value of the parameter name explained before).


When the process is launched for a record in Tab1 the server receives the proper context information.
However, when it's launched for a record in Tab2, the server receives some context from Tab2 (the fields that are displayed) [OK], but also some context information from Tab1 [WRONG].
Actually, this wrong context from Tab1 is null because obviously the user is not in that context.

It looks like, when you have the same process definition in different tabs at the same level, the server always receive the context from the first one instead of the one that is the current context from which the process was launched.


Here you have an example https://pastebin.com/Kg3GgfgC [^]

"TicketTax (line 31)" represents Tab1, and the context is OK. See specially:
 "inpTabId":"41437A37CD784E2CAE78C4F668D31986",
 "inpTableId":"45D52AB170B4486D99FA2A446873E7A1",
 "inpkeyColumnId":"Obcfr_Tickettax_ID",
 "inpKeyName":"inpobcfrTickettaxId",
 "keyColumnName":"Obcfr_Tickettax_ID",
 "inpobcfrTickettaxId":"5F0175D58BF84093A294CE0F57689F5A",
 "Obcfr_Tickettax_ID":"5F0175D58BF84093A294CE0F57689F5A"

"TicketReprint (line 68)" represents Tab2, where the context is wrong. See:
 "inpTabId":"41437A37CD784E2CAE78C4F668D31986", <-- Same as Tab1
 "inpTableId":"45D52AB170B4486D99FA2A446873E7A1", <-- Same as Tab1
 "inpKeyName":"inpobcfrTickettaxId", <-- Same as Tab1
 "keyColumnName":"Obcfr_Tickettax_ID", <-- Same as Tab1
    "inpterminal":null, <-- From Tab1, which is null
    "inpdocumentno":null,
    "inpobcfrTickettaxId":null,
    "Obcfr_Tickettax_ID":null,
    "inptaxrate":null,
    "inptaxbase":null,
    "inptaxamt":null,
Clone repo https://code.openbravo.com/erp/pmods/org.openbravo.certification.france [^] (rev 222d902490b7) in a retail instance.

Insert any record in POS Ticket window and 2 child tabs.
Press Export XML button for the child tabs. Open the files.
Verify TicketTax (Tab1) is properly exported, but TicketReprint (Tab2) actually exports a TicketTax.
No tags attached.
related to defect 0021741 closed AugustoMauch Pick&Execute under some circumstances is not retrieving the selected record ID 
related to defect 00275653.0PR14Q4 closed AugustoMauch Wrong context for add payment selector in transaction tab 
Issue History
2017-12-12 18:06vmromanosNew Issue
2017-12-12 18:06vmromanosAssigned To => platform
2017-12-12 18:06vmromanosModules => Core
2017-12-12 18:06vmromanosTriggers an Emergency Pack => No
2017-12-12 19:07caristuAssigned Toplatform => caristu
2017-12-12 19:08caristuStatusnew => scheduled
2017-12-12 19:26hgbotCheckin
2017-12-12 19:26hgbotNote Added: 0101007
2017-12-13 09:51hgbotCheckin
2017-12-13 09:51hgbotNote Added: 0101009
2017-12-13 09:51hgbotStatusscheduled => resolved
2017-12-13 09:51hgbotResolutionopen => fixed
2017-12-13 09:51hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6dc5085e9168c8e3d07160859ec5e094c1b98ad5 [^]
2017-12-13 09:52caristuReview Assigned To => alostale
2017-12-13 09:54caristuRelationship addedrelated to 0021741
2017-12-13 09:56caristuRelationship addedrelated to 0027565
2017-12-15 10:18alostaleNote Added: 0101053
2017-12-15 10:18alostaleStatusresolved => closed
2017-12-15 10:18alostaleFixed in Version => 3.0PR18Q1
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101522
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101523
2018-01-03 23:03hgbotCheckin
2018-01-03 23:03hgbotNote Added: 0101540

Notes
(0101007)
hgbot   
2017-12-12 19:26   
Repository: erp/devel/pi
Changeset: 5f8684771e7a64347795d0260905df1326403134
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Dec 12 19:25:59 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/5f8684771e7a64347795d0260905df1326403134 [^]

related to issue 37465: initial code clean up

  - Removed the declaration of some unused variables.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
---
(0101009)
hgbot   
2017-12-13 09:51   
Repository: erp/devel/pi
Changeset: 6dc5085e9168c8e3d07160859ec5e094c1b98ad5
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Dec 13 09:33:35 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6dc5085e9168c8e3d07160859ec5e094c1b98ad5 [^]

fixes bug 37465: problem with process definition in several tabs of same window

  When executing a standard process, the view owner of the related action button is used to retrieve the current record information to the server. In this case, to look for that owner view, we were going through all the views in the current window in order to find an action button referencing to the process we are executing. The first view found complying that requirement was considered the owner view. This approach is not valid in case we want to define in several tabs of the same window different buttons referencing to the same process definition.

  To fix the problem, now when we are opening the process we send the owner view of the action button as a parameter which is already supported by the infrastructure of the standard window. Thus, when executing the process we do not need anymore to go through all the views in the current window to find the owner view of the action button.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
---
(0101053)
alostale   
2017-12-15 10:18   
reviewed + tested
(0101522)
hudsonbot   
2018-01-03 12:39   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0101523)
hudsonbot   
2018-01-03 12:39   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0101540)
hgbot   
2018-01-03 23:03   
Repository: erp/pmods/org.openbravo.certification.france
Changeset: 72d8384691e70b53896f7ac582d2734a96bbc8f5
Author: Mark <markmm82 <at> gmail.com>
Date: Wed Jan 03 12:13:46 2018 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.certification.france/rev/72d8384691e70b53896f7ac582d2734a96bbc8f5 [^]

Add a new process definition to these entities:
1. TicketTax
2. TicketReprint
3. TerminalMonitor
4. AggregationDay
5. AggregationMonth
6. AggregationYear
It avoid behaviour explained on issue 37465, when the same process definition is
used in several tabs in same window, to don't send wrong information to server.

---
M src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
M src-db/database/sourcedata/OBUIAPP_PROCESS.xml
---