Project:
| View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | ||||||||
| 0036397 | ||||||||
| Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
| backport | [Openbravo ERP] 09. Financial management | minor | N/A | 2017-07-04 08:33 | 2017-07-11 10:15 | |||
| Reporter | caristu | View Status | public | |||||
| Assigned To | collazoandy4 | |||||||
| Priority | high | Resolution | fixed | Fixed in Version | 3.0PR17Q3 | |||
| Status | closed | Fix in branch | Fixed in SCM revision | cd7822ad1e55 | ||||
| Projection | none | ETA | none | Target Version | 3.0PR17Q3 | |||
| OS | Any | Database | Any | Java version | ||||
| OS Version | Database version | Ant version | ||||||
| Product Version | SCM revision | |||||||
| Merge Request Status | ||||||||
| Review Assigned To | aferraz | |||||||
| OBNetwork customer | No | |||||||
| Web browser | ||||||||
| Modules | Core | |||||||
| Support ticket | ||||||||
| Regression level | ||||||||
| Regression date | ||||||||
| Regression introduced in release | ||||||||
| Regression introduced by commit | ||||||||
| Triggers an Emergency Pack | No | |||||||
| Summary | 0036397: Avoid casting to Object when adding numeric results from a SimpleCallout | |||||||
| Description | 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 | |||||||
| 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 Solution | 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)); | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Relationships [ Relation Graph ]
[ Dependency Graph ]
|
||||||||
|
||||||||
Notes |
|
|
(0097976) hgbot (developer) 2017-07-10 13:32 |
Repository: erp/backports/3.0PR17Q3 Changeset: cd7822ad1e55aae6205a615192e6a38508bbca3c Author: Armaignac <collazoandy4 <at> gmail.com> Date: Mon Jul 10 12:49:45 2017 +0200 URL: http://code.openbravo.com/erp/backports/3.0PR17Q3/rev/cd7822ad1e55aae6205a615192e6a38508bbca3c [^] Fixes issue 36397: 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 --- |
|
(0098008) hgbot (developer) 2017-07-11 10:14 |
Repository: erp/backports/3.0PR17Q3 Changeset: e925840e8cc20c823b59dcc9c700fa3c0d67dbff Author: Armaignac <collazoandy4 <at> gmail.com> Date: Mon Jul 10 15:08:05 2017 -0400 URL: http://code.openbravo.com/erp/backports/3.0PR17Q3/rev/e925840e8cc20c823b59dcc9c700fa3c0d67dbff [^] Related to issue 36397: 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 --- |
|
(0098010) aferraz (viewer) 2017-07-11 10:15 |
Code review + Testing OK |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2017-07-04 12:15 | aferraz | Type | defect => backport |
| 2017-07-04 12:15 | aferraz | Target Version | => 3.0PR17Q3 |
| 2017-07-10 13:32 | hgbot | Checkin | |
| 2017-07-10 13:32 | hgbot | Note Added: 0097976 | |
| 2017-07-10 13:32 | hgbot | Status | scheduled => resolved |
| 2017-07-10 13:32 | hgbot | Resolution | open => fixed |
| 2017-07-10 13:32 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/backports/3.0PR17Q3/rev/cd7822ad1e55aae6205a615192e6a38508bbca3c [^] |
| 2017-07-11 10:14 | hgbot | Checkin | |
| 2017-07-11 10:14 | hgbot | Note Added: 0098008 | |
| 2017-07-11 10:15 | aferraz | Review Assigned To | => aferraz |
| 2017-07-11 10:15 | aferraz | Note Added: 0098010 | |
| 2017-07-11 10:15 | aferraz | Status | resolved => closed |
| 2017-07-11 10:15 | aferraz | Fixed in Version | => 3.0PR17Q3 |
| Copyright © 2000 - 2009 MantisBT Group |