Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021741Openbravo ERPA. Platformpublic2012-09-25 11:492012-10-11 07:50
mirurita 
AugustoMauch 
normalmajoralways
closedfixed 
20Community Appliance
 
3.0MP17 
dbaz
Core
No
0021741: Pick&Execute under some circumstances is not retrieving the selected record ID
Pick&Execute under some circumstances is not retrieving the selected record ID

"inpcProjectId" parameter contains header contract ID.

------------------------------------------------------
    "inpissummary":"Y",
    "inpisactive":"Y",
    "inpcProjectId":"81066B364742464DB75269440E8A3B86",
    "inpprojectcategory":"OBHCNTR_PARENT",
    "inpadClientId":"23C59575B9CF467C9620760EB255B389",
    "C_Project_ID":"81066B364742464DB75269440E8A3B86",
    "inpadOrgId":"B843C30461EA4501935CB1D125C9C25A",
    "inpemObhcntrDocumentno":"1000004",
    "inpvalue":"Test1",
    "inpname":"Test1",
    "inpcBpartnerId":"A6750F0D15334FB890C254369AC750A8",
    "inpcBpartnerLocationId":"6518D3040ED54008A1FC0C09ED140D66",
    "inpdescription":null,
    "inpstartdate":"01-09-2012",
    "inpdatefinish":"31-10-2012",
    "inpcCurrencyId":"102",
    "inpcPaymenttermId":"66BA1164A7394344BB9CD1A6ECEED05D",
    "inpmPricelistId":"AEE66281A08F42B6BC509B8A80A33C29",
    "inpfinPaymentmethodId":"A97CFD2AFC234B59BB0A72189BD8FC2A",
    "inpsalesrepId":"C3503BEFB3CB4848A674284A656163B9",
    "inpresponsibleId":"6F96792A1F2142DCA3E98FE5C6570256",
    "inpadUserId":"6B1E8F0CA1524850AB3A7F9AE475A16F",
    "inpprojectstatus":"OP",
    "inpemObhcntrContracttotalamount":"66,00",
    "inpTabId":"8F9CA53965834621900034A7C378127E",
    "inpwindowId":"279D7835E0C648F0987B421752523387",
    "inpTableId":"203",
    "inpkeyColumnId":"C_Project_ID",
    "keyProperty":"id",
    "inpKeyName":"inpcProjectId",
    "keyColumnName":"C_Project_ID",
    "keyPropertyType":"_id_13",
------------------------------------------------------
1) Install the following modules
https://code.openbravo.com/private/eulen/org.openbravo.contract/ [^]
https://code.openbravo.com/private/eulen/org.openbravo.contract.hierarchical/ [^]
https://code.openbravo.com/private/eulen/org.openbravo.project.budget/ [^]

2) Go to "Budget Account Groups" window
2.1) Create new group
      - Name: Group1
3) Go to "Budget Account" window
3.1) Create a new budget account
      - Account Group: Group1
      - Account Element: 10000 - Capital social
4) Go to "Contract" window
4.1) Create a header record:
  + Name: parent
  + Search Key: parent
5) Go to Lines tab and create a child record
  + Name: child
  + Search Key: child
6) Click on "Set account amount" button
7) In the pick&execute popup enter 100 as amount
8) Important: put a breakpoint on
org.openbravo.project.budget.process.PickSelectLines java class line 43
9) Click on Done
10) Go to eclipse and try to retrieve the id of the contract line.
jsonRequest.getString("inpcProjectId");
previous statement is returning the id of the header record.
Note: header and lines tab are based on the same table (c_project).
No tags attached.
related to defect 00227133.0MP19 closed AugustoMauch Pick/Edit is not working correctly when it is associated to the lines tab instead of to the header 
related to defect 0037465 closed caristu Same process definition in several tabs in same window sends wrong information to server 
diff issue21741.diff (3,713) 2012-10-04 10:10
https://issues.openbravo.com/file_download.php?file_id=5636&type=bug
Issue History
2012-09-25 11:49miruritaNew Issue
2012-09-25 11:49miruritaAssigned To => AugustoMauch
2012-09-25 11:49miruritaModules => Core
2012-09-25 11:50miruritaNote Added: 0052544
2012-09-25 11:50miruritaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=3897#r3897
2012-09-25 11:56miruritaDescription Updatedbug_revision_view_page.php?rev_id=3899#r3899
2012-09-27 19:19AugustoMauchIssue Monitored: dbaz
2012-09-27 19:19AugustoMauchClosed by => dbaz
2012-09-27 19:38hgbotCheckin
2012-09-27 19:38hgbotNote Added: 0052849
2012-09-27 19:38hgbotStatusnew => resolved
2012-09-27 19:38hgbotResolutionopen => fixed
2012-09-27 19:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3b92f8d1358acf08e5ac20ed0ec71bdc0d9c6ebd [^]
2012-09-27 23:14dbazNote Added: 0052852
2012-09-27 23:14dbazStatusresolved => new
2012-09-27 23:14dbazResolutionfixed => open
2012-09-28 14:39hudsonbotCheckin
2012-09-28 14:39hudsonbotNote Added: 0052925
2012-09-28 15:29hgbotCheckin
2012-09-28 15:29hgbotNote Added: 0052929
2012-10-04 10:10AugustoMauchFile Added: issue21741.diff
2012-10-04 10:11AugustoMauchStatusnew => scheduled
2012-10-04 10:11AugustoMauchfix_in_branch => pi
2012-10-04 18:18hudsonbotCheckin
2012-10-04 18:18hudsonbotNote Added: 0053046
2012-10-08 16:00hgbotCheckin
2012-10-08 16:00hgbotNote Added: 0053116
2012-10-08 16:00hgbotStatusscheduled => resolved
2012-10-08 16:00hgbotResolutionopen => fixed
2012-10-08 16:00hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/3b92f8d1358acf08e5ac20ed0ec71bdc0d9c6ebd [^] => http://code.openbravo.com/erp/devel/pi/rev/7b49d037a0cfd3923b867165523ca3f38c2631af [^]
2012-10-09 13:11dbazNote Added: 0053165
2012-10-09 13:13dbazStatusresolved => new
2012-10-09 13:13dbazResolutionfixed => open
2012-10-09 13:22hgbotCheckin
2012-10-09 13:22hgbotNote Added: 0053170
2012-10-09 13:22hgbotStatusnew => resolved
2012-10-09 13:22hgbotResolutionopen => fixed
2012-10-09 13:22hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/7b49d037a0cfd3923b867165523ca3f38c2631af [^] => http://code.openbravo.com/erp/devel/pi/rev/3a5e020f0c97ca7f84ae27f52e27d55362738534 [^]
2012-10-09 14:15dbazNote Added: 0053175
2012-10-09 14:15dbazStatusresolved => closed
2012-10-09 14:15dbazFixed in Version => 3.0MP17
2012-10-10 16:35hudsonbotCheckin
2012-10-10 16:35hudsonbotNote Added: 0053219
2012-10-11 07:50hudsonbotCheckin
2012-10-11 07:50hudsonbotNote Added: 0053278
2013-01-10 11:12AugustoMauchRelationship addedrelated to 0022713
2017-12-13 09:54caristuRelationship addedrelated to 0037465

Notes
(0052544)
mirurita   
2012-09-25 11:50   
This issue is important for Contract Management project.
(0052849)
hgbot   
2012-09-27 19:38   
Repository: erp/devel/pi
Changeset: 3b92f8d1358acf08e5ac20ed0ec71bdc0d9c6ebd
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Sep 27 19:37:28 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3b92f8d1358acf08e5ac20ed0ec71bdc0d9c6ebd [^]

Fixes issue 21741: Pick&Execute under some circumstances is not retrieving the selected record ID

The root cause of this problem is that the context information was getting retrieved from the header tab, instead of the tab that was selected when the pick a
nd execute window was selected. Another change has been done so that that same tab will be selected when the P&E window is closed, otherwise the record could not be refreshed, because the row ID saved in the window belong to the tab that was focused when the P&E window was opened.

---
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/process/ob-pick-and-execute-view.js
---
(0052852)
dbaz   
2012-09-27 23:14   
The fix is not complete.

If you see this line:

https://code.openbravo.com/erp/devel/pi/rev/3b92f8d1358acf08e5ac20ed0ec71bdc0d9c6ebd#l2.7 [^]

at the end the previous active view is set as active view again, this is ok.
The problem is with the code previous to that.

As you can see, there is a function that sets a message in the view. This happens only if the backend returns a message.

The problem is that in the way the solution is implemented, it always will return the message window to the parent tab instead to the "good" tab.

Now my question is that what "good" tab means: There are two possible interpretations:
a) The active one from where you have pushed the process button. The fix in this case I think is as easy as put the line:
this.sourceView.setAsActiveView();
before
if (message) { ...

b) The view where the button belongs: so, if for example, the process belongs to the parent, but you have the focus in the child, and from the child you press the process button, the returned message should be draw in the parent tab, since the process belongs to it.

To do tests with messages, you can hardcode a message directly in the javascript to ensure always something is displayed. Example, add in this line
https://code.openbravo.com/erp/devel/pi/file/3b92f8d1358a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-view.js#l200 [^]
this code:

message.severity = 'error';
message.text = 'This is a test message';
(0052925)
hudsonbot   
2012-09-28 14: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/6d2f8cffd4b1 [^]

Maturity status: Test
(0052929)
hgbot   
2012-09-28 15:29   
Repository: erp/devel/pi
Changeset: a3f3fdcb497069c26d26f0ae2f505dd1ad7691e9
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Sep 28 15:28:44 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a3f3fdcb497069c26d26f0ae2f505dd1ad7691e9 [^]

Related to issue 21741: Backout of changeset 18066

The changed that only fixed this issue partially has been backed out. The complete fix will be included in MP17.

---
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/process/ob-pick-and-execute-view.js
---
(0053046)
hudsonbot   
2012-10-04 18:18   
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/c067ea513614 [^]

Maturity status: Test
(0053116)
hgbot   
2012-10-08 16:00   
Repository: erp/devel/pi
Changeset: 7b49d037a0cfd3923b867165523ca3f38c2631af
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Oct 08 15:52:10 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7b49d037a0cfd3923b867165523ca3f38c2631af [^]

Fixes issue 21741:P&E is not retrieving the selected record ID

Now, after returning from a P&E process, the focus goes to the tab owner of the process, following the same behavior as the non P&E processes.

---
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/process/ob-pick-and-execute-view.js
---
(0053165)
dbaz   
2012-10-09 13:11   
The returned messge (if exists) should also be displayed in the tab where the button belongs to
(0053170)
hgbot   
2012-10-09 13:22   
Repository: erp/devel/pi
Changeset: 3a5e020f0c97ca7f84ae27f52e27d55362738534
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Oct 09 13:20:36 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3a5e020f0c97ca7f84ae27f52e27d55362738534 [^]

Fixes issue 21741: P&E return messages are shown in the process owner view

Before the fix, the messages returned by the P&E windows were shown in the header view, but it should be shown in the view to which the process belongs to.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-view.js
---
(0053175)
dbaz   
2012-10-09 14:15   
Reviewed @ changeset: 18175 - f2ec6da4445f
(0053219)
hudsonbot   
2012-10-10 16:35   
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/b088fe9dfe19 [^]

Maturity status: Test
(0053278)
hudsonbot   
2012-10-11 07:50   
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/63dfc135f2a1 [^]

Maturity status: Test