Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036392
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 09. Financial managementminorN/A2017-07-04 08:332017-09-21 16:49
ReportercaristuView Statuspublic 
Assigned Tocollazoandy4 
PriorityhighResolutionfixedFixed in Version3.0PR17Q4
StatusclosedFix in branchFixed in SCM revisionf06d1fb9752b
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toaferraz
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036392: Avoid casting to Object when adding numeric results from a SimpleCallout

DescriptionAvoid 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
Steps To Reproduce- 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);
Proposed SolutionReplace 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));
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0036302 closedplatform Display logic in fields is not working in callouts using SimpleCallout 
related to design defect 0036067 closedmarkmm82 old callouts should be refactored to implement SimpleCallout 
related to feature request 0034693 closeddmiguelez Support Multi UOM in Openbravo 
depends on backport 00363973.0PR17Q3 closedcollazoandy4 Avoid casting to Object when adding numeric results from a SimpleCallout 
depends on backport 00363983.0PR17Q2.2 closedcollazoandy4 Avoid casting to Object when adding numeric results from a SimpleCallout 
depends on backport 00363993.0PR17Q1.3 closedcollazoandy4 Avoid casting to Object when adding numeric results from a SimpleCallout 
caused by design defect 00323663.0PR16Q4 closedinigosanchez callout invocation ineficiencies 
related to defect 0036590 closedmarkmm82 Callouts retrieve wrong quantity when Format.xml file is set with too many decimals 

-  Notes
(0097892)
collazoandy4 (developer)
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 (developer)
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 (developer)
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 (developer)
2017-07-11 10:13

Code review + Testing OK
(0099260)
hudsonbot (developer)
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 (developer)
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

- Issue History
Date Modified Username Field Change
2017-07-04 08:33 caristu New Issue
2017-07-04 08:33 caristu Assigned To => Triage Finance
2017-07-04 08:33 caristu Modules => Core
2017-07-04 08:33 caristu Triggers an Emergency Pack => No
2017-07-04 08:33 caristu Relationship added related to 0036302
2017-07-04 08:34 caristu Relationship added caused by 0032366
2017-07-04 08:51 caristu Summary Avoid casting to Object when adding results from a SimpleCallout => Avoid casting to Object when adding numeric results from a SimpleCallout
2017-07-04 08:51 caristu Description Updated View Revisions
2017-07-04 12:14 aferraz Assigned To Triage Finance => collazoandy4
2017-07-04 12:15 aferraz Status new => scheduled
2017-07-05 22:55 collazoandy4 Note Added: 0097892
2017-07-10 13:03 aferraz Relationship added related to 0036067
2017-07-10 13:29 aferraz Relationship added related to 0034693
2017-07-10 13:30 hgbot Checkin
2017-07-10 13:30 hgbot Note Added: 0097975
2017-07-10 13:30 hgbot Status scheduled => resolved
2017-07-10 13:30 hgbot Resolution open => fixed
2017-07-10 13:30 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f06d1fb9752b34f289dbd4bee71e0b0257c8c469 [^]
2017-07-11 10:11 hgbot Checkin
2017-07-11 10:11 hgbot Note Added: 0098004
2017-07-11 10:13 aferraz Review Assigned To => aferraz
2017-07-11 10:13 aferraz Note Added: 0098006
2017-07-11 10:13 aferraz Status resolved => closed
2017-07-11 10:13 aferraz Fixed in Version => 3.0PR17Q4
2017-08-09 14:09 inigosanchez Relationship added related to 0036590
2017-09-21 16:49 hudsonbot Checkin
2017-09-21 16:49 hudsonbot Note Added: 0099260
2017-09-21 16:49 hudsonbot Checkin
2017-09-21 16:49 hudsonbot Note Added: 0099265


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker