Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036392Openbravo ERP09. Financial managementpublic2017-07-04 08:332017-09-21 16:49
caristu 
collazoandy4 
highminorN/A
closedfixed 
5
 
3.0PR17Q4 
aferraz
Core
No
0036392: Avoid casting to Object when adding numeric results from a SimpleCallout
Avoid casting to Object when adding numeric values from a SimpleCallout. Before the callout refactor project (see 0032366), to set the value of a quantity it was possible to do the following:

String strHasSecondaryUOM = SLOrderProductData.hasSecondaryUOM(this, strMProductID);
info.addResult("inphasseconduom", (Object) strHasSecondaryUOM);

With the previous API, this avoided to send the value of a String surrounded by quotes. Thus, the value was finally being interpreted as a numeric value.

With the changes introduced in the mentioned project the API is more compact and it is not necessary to surround the strings between quotes to specify a string value. Therefore such castings should not be done as the type of the values is managed internally with a JSONObject.

The callouts affected by this internal change are:

- src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java
- src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Product.java
- src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Product.java
- Login as System Admin Role
- Mark as displayed = Yes fields
  - Window: Goods Receipt/ Shipment, Tab: Lines, Fields: Order Quantity, Order Uom
  - Window: Goods Movement, Tab: Lines, Fields: Order Quantity, Order Uom
- Window: Physical Inventory, Tab: Lines, Fields: Order Quantity, Order Uom
- Logout
- Login as QA Testing Admin.
- Create a new Product "Test Product".
- Assign second UOM as Kilogram to "Test Product" in the UOM Tab
- Create a Goods Receipt
- Add a line and select the Test Product, enter Movement Quantity 1
- Realize that Order Uom and Order Quantity fields are not displayed.
- Save Record and Refresh (as Display Logic does not work)
- Realize that Order Uom and Order Quantity fields are displayed.

Note that the display logic is not working because of the fact that the display logic condition is expecting a numeric value. But a string is being sent:

info.addResult("inphasseconduom", (Object) strHasSecondaryUOM);
Replace the castings to Object in the mentioned callouts by sending the corresponding numeric value when it applies. For example

Instead of:

info.addResult("inphasseconduom", (Object) strHasSecondaryUOM);

Use:

info.addResult("inphasseconduom", Integer.parseInt(strHasSecondaryUOM));
No tags attached.
related to defect 0036302 closed platform Display logic in fields is not working in callouts using SimpleCallout 
related to design defect 0036067 closed markmm82 old callouts should be refactored to implement SimpleCallout 
related to feature request 0034693 closed dmiguelez Support Multi UOM in Openbravo 
depends on backport 00363973.0PR17Q3 closed collazoandy4 Avoid casting to Object when adding numeric results from a SimpleCallout 
depends on backport 00363983.0PR17Q2.2 closed collazoandy4 Avoid casting to Object when adding numeric results from a SimpleCallout 
depends on backport 00363993.0PR17Q1.3 closed collazoandy4 Avoid casting to Object when adding numeric results from a SimpleCallout 
caused by design defect 00323663.0PR16Q4 closed inigosanchez callout invocation ineficiencies 
related to defect 0036590 closed markmm82 Callouts retrieve wrong quantity when Format.xml file is set with too many decimals 
Issue History
2017-07-04 08:33caristuNew Issue
2017-07-04 08:33caristuAssigned To => Triage Finance
2017-07-04 08:33caristuModules => Core
2017-07-04 08:33caristuTriggers an Emergency Pack => No
2017-07-04 08:33caristuRelationship addedrelated to 0036302
2017-07-04 08:34caristuRelationship addedcaused by 0032366
2017-07-04 08:51caristuSummaryAvoid casting to Object when adding results from a SimpleCallout => Avoid casting to Object when adding numeric results from a SimpleCallout
2017-07-04 08:51caristuDescription Updatedbug_revision_view_page.php?rev_id=15454#r15454
2017-07-04 12:14aferrazAssigned ToTriage Finance => collazoandy4
2017-07-04 12:15aferrazStatusnew => scheduled
2017-07-05 22:55collazoandy4Note Added: 0097892
2017-07-10 13:03aferrazRelationship addedrelated to 0036067
2017-07-10 13:29aferrazRelationship addedrelated to 0034693
2017-07-10 13:30hgbotCheckin
2017-07-10 13:30hgbotNote Added: 0097975
2017-07-10 13:30hgbotStatusscheduled => resolved
2017-07-10 13:30hgbotResolutionopen => fixed
2017-07-10 13:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f06d1fb9752b34f289dbd4bee71e0b0257c8c469 [^]
2017-07-11 10:11hgbotCheckin
2017-07-11 10:11hgbotNote Added: 0098004
2017-07-11 10:13aferrazReview Assigned To => aferraz
2017-07-11 10:13aferrazNote Added: 0098006
2017-07-11 10:13aferrazStatusresolved => closed
2017-07-11 10:13aferrazFixed in Version => 3.0PR17Q4
2017-08-09 14:09inigosanchezRelationship addedrelated to 0036590
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099260
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099265

Notes
(0097892)
collazoandy4   
2017-07-05 22:55   
Test Plan
  As System Admin Role
   Go to Windows, Tabs and Fields window and set displayed = Yes for this fields
    Window: Goods Receipt, Tab: Lines, Fields: Order Quantity, Order Uom
    Window: Goods Shipment, Tab: Lines, Fields: Order Quantity, Order Uom
    Window: Goods Movement, Tab: Lines, Fields: Order Quantity, Order Uom
    Window: Product, Tab: UOM
    Window: Physical Inventory, Tab: Lines, Fields: Order Quantity, Order Uom
   Logout
  Login as QA Testing Admin.
   Go to Product window and create a new record:
    Search Key / Name: Test Product
   Create a new record in UOM tab:
    UOM: Kilogram
   Go to Goods Receipt window and create a new record:
    Create a new record in Lines tab and select the Test Product with Movement Quantity 1
    Check Order Uom and Order Quantity fields are displayed.
   Go to Goods Shipment window and create a new record:
    Create a new record in Lines tab and select the Test Product with Movement Quantity 1
    Check Order Uom and Order Quantity fields are displayed.
   Go to Goods Movement window and create a new record:
    Create a new record in Lines tab and select the Test Product with Movement Quantity 1
    Check Order Uom and Order Quantity fields are displayed.
   Go to Physical Inventory window and create a new record:
    Create a new record in Lines tab and select the Test Product with Movement Quantity 1
    Check Order Uom and Order Quantity fields are displayed.
(0097975)
hgbot   
2017-07-10 13:30   
Repository: erp/devel/pi
Changeset: f06d1fb9752b34f289dbd4bee71e0b0257c8c469
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Mon Jul 10 12:49:45 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f06d1fb9752b34f289dbd4bee71e0b0257c8c469 [^]

Fixes issue 36392: Avoid casting when adding numeric results in SimpleCallout

The casting to Object was replace by a integer conversion, sending the
corresponding numeric value when it applies.

---
M src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Product.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Product.java
---
(0098004)
hgbot   
2017-07-11 10:11   
Repository: erp/devel/pi
Changeset: 43ba9a3ad9e9e19caffa641dfe3392775ed4da31
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Mon Jul 10 15:08:05 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/43ba9a3ad9e9e19caffa641dfe3392775ed4da31 [^]

Related to issue 36392: Hide secondUOM fields if product doesn't have secondUOM

When a product with a second UOM was selected the associated fields are shown,
but not hidden when the product is change and doesn't have a second UOM because
the has_second_uom var is not updated with the corresponding value according
to the product selection.

The value of has_second_uom var is updated according to the product selection
in the result for a correct use in display logic function.

---
M src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java
---
(0098006)
aferraz   
2017-07-11 10:13   
Code review + Testing OK
(0099260)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test
(0099265)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test