Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036184Openbravo ERP04. Warehouse managementpublic2017-06-06 13:552017-06-09 22:41
ngarcia 
markmm82 
immediatemajoralways
closedfixed 
5
 
3.0PR17Q3 
aferraz
Core
Production - Confirmed Stable
2016-12-02
3.0PR17Q1
https://code.openbravo.com/erp/devel/pi/rev/cde4e226d8de [^]
No
0036184: Cannot select an order line in Create Lines From of Goods Receipt window if it uses secondary UOM
Cannot select an order line in Create Lines From of Goods Receipt window if it uses secondary UOM
As system admin role:
   Set as displayed the 'Order Quantity' and 'Order UOM' fields of at least purchase order and goods receipt lines
   Set as active 'Product - UOM' and 'Unit Of Measure - Conversion' tabs

As group admin role:
   Create a new product
   Add a purchase price list to it
   Set a unit in the UOM tab, for example Kg
   Define a conversion between Kg and Unit
   Create a purchase order, add a line to it and include the previously created product
   Select Kg in Order UOM field and set the quantity in Order Quantity field
   Book it
   Create a Goods Receipt header
   Click on Create Lines From and select the already created order line
   Add a storage bin and click on OK
   Check the following error message is shown:

     "This record cannot be deleted because it is associated with other existing elements. Please see Linked Items"

   The logs shows:

   ERROR org.openbravo.erpCommon.ad_actionButton.CreateFromShipmentData - SQL error in query: INSERT INTO M_INOUTLINE ...

Exception:org.postgresql.util.PSQLException: ERROR: insert or update on table "m_inoutline" violates foreign key constraint "m_inoutline_m_product_uom"
  Detail: Key (m_product_uom_id)=(72BA247D31F745F3AF11F74A5E2CCBEF) is not present in table "m_product_uom".
   
No tags attached.
depends on backport 00361943.0PR17Q2.1 closed markmm82 Cannot select an order line in Create Lines From of Goods Receipt window if it uses secondary UOM 
depends on backport 00361953.0PR17Q1.2 closed markmm82 Cannot select an order line in Create Lines From of Goods Receipt window if it uses secondary UOM 
caused by feature request 0034693 closed dmiguelez Support Multi UOM in Openbravo 
related to defect 0036216 closed inigosanchez Not possible to change secondary quantity nor secondary unit in Goods Receipt create lines from process 
Issue History
2017-06-06 13:55ngarciaNew Issue
2017-06-06 13:55ngarciaAssigned To => Triage Finance
2017-06-06 13:55ngarciaModules => Core
2017-06-06 13:55ngarciaResolution time => 1498514400
2017-06-06 13:55ngarciaTriggers an Emergency Pack => No
2017-06-06 13:55ngarciaIssue Monitored: networkb
2017-06-06 17:44aferrazAssigned ToTriage Finance => markmm82
2017-06-06 18:08markmm82Statusnew => acknowledged
2017-06-07 17:33markmm82Note Added: 0097195
2017-06-07 22:11markmm82Statusacknowledged => scheduled
2017-06-07 22:25markmm82Note Edited: 0097195bug_revision_view_page.php?bugnote_id=0097195#r15307
2017-06-07 22:26markmm82Note Edited: 0097195bug_revision_view_page.php?bugnote_id=0097195#r15308
2017-06-08 10:19aferrazRelationship addedcaused by 0034693
2017-06-08 10:51aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15310#r15310
2017-06-08 11:18aferrazRegression level => Production - Confirmed Stable
2017-06-08 11:18aferrazRegression date => 2016-12-02
2017-06-08 11:18aferrazRegression introduced in release => 3.0PR17Q1
2017-06-08 11:18aferrazRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/cde4e226d8de [^]
2017-06-09 09:54aferrazRelationship addedrelated to 0036216
2017-06-09 12:18aferrazNote Edited: 0097195bug_revision_view_page.php?bugnote_id=0097195#r15318
2017-06-09 13:35hgbotCheckin
2017-06-09 13:35hgbotNote Added: 0097287
2017-06-09 13:35hgbotStatusscheduled => resolved
2017-06-09 13:35hgbotResolutionopen => fixed
2017-06-09 13:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d5b16e274d2cc9602a9101ce3215f274be5a356e [^]
2017-06-09 13:36aferrazReview Assigned To => aferraz
2017-06-09 13:36aferrazNote Added: 0097288
2017-06-09 13:36aferrazStatusresolved => closed
2017-06-09 13:36aferrazFixed in Version => 3.0PR17Q3
2017-06-09 22:41hudsonbotCheckin
2017-06-09 22:41hudsonbotNote Added: 0097298

Notes
(0097195)
markmm82   
2017-06-07 17:33   
(edited on: 2017-06-09 12:18)
Test Plan 1: Using Secondary Units of Measure
As system admin role:
   Set as displayed the 'Order Quantity' and 'Order UOM' fields of at least purchase order and goods receipt lines
   Set as active 'Product - UOM' and 'Unit Of Measure - Conversion' tabs

As group admin role:
   Create a new product, for instance A
   Add a purchase price list to it
   Set a unit in the UOM tab, for example Liter
   Define a conversion between Liter and Unit = 10
   Create a purchase order, add a line to it and include the previously created product. Be sure to fill this values in More Information section:
     Select Liter in Order UOM field and set the quantity in Order Quantity field = 10.
     Notice the Order quantity is updated to 100 because teh conversion between Liter and Unit.
   Book it
   Create a Goods Receipt header
   Click on Create Lines From and select the already created order line, using the Secondary Unit with the purchase order line was created. This case: Liter. Take all the quantity.
   Add a storage bin and click on OK
     Check the process ends successfully.
     Notice in the created line the following values:
        Movement quantity = 100
    UOM = Unit
    Order Quantity = 10
    Order UOM = Liter.
   Complete the receipt, and process is successfully too.

Test Plan 2: Using AUM Management
Use the same settings of Test Plan 1 in order to have configured secondary units and alternate units of measure.
As system admin role:
   Activate the Enable UOM Management Preference.

As group admin role:
   Create a new product, for instance B
   Add a purchase price list to it
   Go to Alternate UOM tab (Notice UOM tab is not visible)
     Define a new one to Liter UOM, Purchase = Primary and Conversion Rate = 20.
   Go to Unit of Measure window and define a conversion between Liter and Unit, rate = 10 if it doesn't exists (Differentiate with created in Alternate UOM)
   Create a purchase order, add a line to it and include the previously created product B.
     Notice Order UOM and Order Quantity fields are not present. Instead there are Operative quantity and Alternative UOM fields.
     Select Liter in Alternative UOM field and set the Operative Quantity as 10.
     Notice the Ordered quantity is updated to 200 because the alternate conversion between Liter and Unit and it is read only.
   Book it
   Create a Goods Receipt header
   Click on Create Lines From and select the already created order line, using the Alternative Unit defined in the purchase order line. This case: Liter. Take all the quantity.
   Add a storage bin and click on OK
     Check the process ends successfully.
     Notice in the created line the following values:
        Operative Quantity = 10
    UOM = Unit
        Alternative UOM = Liter
        Movement Quantity = 200
   Complete the receipt, and process is successfully.

(0097287)
hgbot   
2017-06-09 13:35   
Repository: erp/devel/pi
Changeset: d5b16e274d2cc9602a9101ce3215f274be5a356e
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Jun 08 21:26:48 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/d5b16e274d2cc9602a9101ce3215f274be5a356e [^]

Fixes issue 36184: Cannot select an order line in Create Lines From of Receipt
window if it uses secondary UOM

Cannot select an order line in Create Lines From of Goods Receipt window if it uses
secondary UOM.

It was caused because of use of the secondary unit of measure ID instead of the
M_PRODUCT_UOM_ID when creating the field provider for the field of secondary UOM.

To fix it, was used the M_PRODUCT_UOM_ID of the record when the secondary unit
is defined for the selected product, instead of the ID of it unit.

---
M src/org/openbravo/materialmgmt/UOMUtil.java
---
(0097288)
aferraz   
2017-06-09 13:36   
Code review + Testing OK
(0097298)
hudsonbot   
2017-06-09 22:41   
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/282dd511870b [^]
Maturity status: Test