Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020585Openbravo ERPA. Platformpublic2012-05-23 11:342012-07-26 11:17
mirurita 
dbaz 
urgentmajoralways
closedfixed 
20Community Appliance
pi 
3.0MP143.0MP14 
Core
No
0020585: [Pick&Execute] Sending null value in the table primary column info when the focus is on other tab.
if you open a pick&execute window having the focus in other tab. (i.e. the button/process belongs to the header and you have the focus on lines tab) the header primary key is sent with null value to the backend


For example in "Return to vendor" window when you click on Pick&Edit Lines button the request contains

"inpcOrderId":null,


{
    "inpdocaction":"CO",
    ...
    "inpistaxincluded":"N",
    "inpcOrderId":null,
    "inpisprinted":"N",
    "inpisinvoiced":"N",
1) Go to Return to Vendor window
2) Create a new record for:
    Org: F&B US, Inc.
    Business Partner: Be Soft Drinker, Inc.
3) Save.
4) Important!!!!: change the focus to Lines tab
5) Click on Pick/Edit Lines button
6) Clear the filter.
7) Select any line and enter a valid number on "Returned" cell.
8) Click Done

If you debug on SRMOPickEditLines java class the inpcOrderId you get is "null".
final String strOrderId = jsonRequest.getString("inpcOrderId");

If you click on Pick/Edit lines button having the focus on header tab the inpcOrderId contains the order identifier.
No tags attached.
related to defect 0020578 closed Sandrahuguet Error message appears without any valid information in Return to vendor screen 
Issue History
2012-05-23 11:34miruritaNew Issue
2012-05-23 11:34miruritaAssigned To => alostale
2012-05-23 11:34miruritaModules => Core
2012-05-23 13:19miruritaSummaryPick&Execute sending null value in the table primary column info when the focus is on other tab. => [Pick&Execute] Sending null value in the table primary column info when the focus is on other tab.
2012-05-23 15:32alostaleAssigned Toalostale => guilleaer
2012-05-24 17:03miruritaRelationship addedrelated to 0020578
2012-06-04 19:35miruritaPriorityhigh => urgent
2012-07-20 18:37jonalegriaesarteversion => pi
2012-07-20 18:37jonalegriaesarteTarget Version => 3.0MP14
2012-07-24 14:31dbazNote Added: 0050808
2012-07-24 14:33dbazNote Added: 0050809
2012-07-24 14:33dbazAssigned Toguilleaer => dbaz
2012-07-24 14:36hgbotCheckin
2012-07-24 14:36hgbotNote Added: 0050810
2012-07-24 14:36hgbotStatusnew => resolved
2012-07-24 14:36hgbotResolutionopen => fixed
2012-07-24 14:36hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/deb2d74464b20b01978279fb4b2e5dd6b5f43c0b [^]
2012-07-24 18:48hgbotCheckin
2012-07-24 18:48hgbotNote Added: 0050817
2012-07-25 12:10miruritaNote Added: 0050826
2012-07-26 02:42hudsonbotCheckin
2012-07-26 02:42hudsonbotNote Added: 0050874
2012-07-26 02:42hudsonbotCheckin
2012-07-26 02:42hudsonbotNote Added: 0050876
2012-07-26 11:17miruritaNote Added: 0050895
2012-07-26 11:17miruritaStatusresolved => closed
2012-07-26 11:17miruritaFixed in Version => 3.0MP14

Notes
(0050808)
dbaz   
2012-07-24 14:31   
The problem track from inside to outside:


SRMOPickEditLines.java gets the "inpcOrderId" from the given json. This json is provided in:

ob-pick-and-execute-view.js in the "doProcess" function through the "allProperties" variables obtained from activeView.getContextInfo. This function is set in:

ob-pick-and-execute-grid.js. Here it obtains a "contextInfo" variable from "this.view.parentWindow.activeView.getContextInfo" (the next values addition to the array are irrelevant for this issue). This "getContextInfo" is here:

ob-standard-view.js where there is a "properties = this.propertyToColumns;". In this "this.propertyToColumns" for this case there are (among others):
* inpcOrderId
* C_Order_ID

"this.propertyToColumns" is set in "prepareViewFields" and is obtained from "this.initialPropertyToColumns" which is created in ob-view-tab.js.ftl


For this particular case, when we call the "Pick/Edit Lines" view from "Lines", when there are no lines, and then we modify "Returned" in the grid, "inpcOrderId" is null since the call has been done from a place where there is no line (inpcOrderlineId), so we can not track to the parent/header order (inpcOrderId).
But everything is not lost, since we have always available "C_Order_ID" in all the hierarchy because it doesn't depend on the selected record (at any level) but on the view itself
(0050809)
dbaz   
2012-07-24 14:33   
Since it is a "functional" issue, the fix should be reviewed by "SRMOPickEditLines.java" developer to ensure that the fix is ok and it doesn't cause any regression.
(0050810)
hgbot   
2012-07-24 14:36   
Repository: erp/devel/pi
Changeset: deb2d74464b20b01978279fb4b2e5dd6b5f43c0b
Author: David Baz Fayos <david.baz <at> openbravo.com>
Date: Tue Jul 24 14:35:51 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/deb2d74464b20b01978279fb4b2e5dd6b5f43c0b [^]

Fixed issue 20585: 'Return to Vendor' [PNE] now works ok called from lines
when there are not lines yet

---
M src/org/openbravo/common/actionhandler/SRMOPickEditLines.java
---
(0050817)
hgbot   
2012-07-24 18:48   
Repository: erp/devel/pi
Changeset: 9ccfd2754c6a8c9c88ed9b8914655298f30afea6
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Tue Jul 24 18:47:18 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9ccfd2754c6a8c9c88ed9b8914655298f30afea6 [^]

Related to issue 20585: change RMShipmentPickEditLines and SRMOPickEditLines.
Same problem was affecting Return to Vendor Shipment and Return Material Receipt.
When the focus is NOT in the tab of the button (i.e. any child tab) and the tab does not
contain any record, the inpcXXXXId parameter contains null string. Use table primary key
column name instead (i.e. C_Order_ID, M_InOut_ID, ...) because it always contains the id of the selected
header record.

---
M src/org/openbravo/common/actionhandler/RMInOutPickEditLines.java
M src/org/openbravo/common/actionhandler/RMShipmentPickEditLines.java
M src/org/openbravo/common/actionhandler/SRMOPickEditLines.java
---
(0050826)
mirurita   
2012-07-25 12:10   
Alternative Test Plan I
1) Create a Return to Vendor for "Be Soft Drinker, Inc."
2) Go to Return to Vendor Shipment window
3) Create a new record for:
    Org: F&B US, Inc.
    Business Partner: Be Soft Drinker, Inc.
4) Save.
5) Important!!!!: change the focus to Lines tab
6) Click on Pick/Edit Lines button
7) Clear the filter.
8) Select any line and enter a valid number on "Ship Qty" cell.
9) Click Done
10) Verify: the line should be included.

Alternative Test Plan II
1) Create a Return from Customer for "Healthy Food Supermarkets, Co."
2) Go to Return to Vendor Shipment window
3) Create a new record for:
    Org: F&B US, Inc.
    Business Partner: Healthy Food Supermarkets, Co.
4) Save.
5) Important!!!!: change the focus to Lines tab
6) Click on Pick/Edit Lines button
7) Clear the filter.
8) Select any line and enter a valid number on "Ship Qty" cell.
9) Click Done
10) Verify: the line should be included.
(0050874)
hudsonbot   
2012-07-26 02:42   
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/5edf203d5780 [^]

Maturity status: Test
(0050876)
hudsonbot   
2012-07-26 02:42   
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/5edf203d5780 [^]

Maturity status: Test
(0050895)
mirurita   
2012-07-26 11:17   
code review + testing plans executed successfully