Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037882Openbravo ERP03. Procurement managementpublic2018-02-12 11:152018-03-02 21:18
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q2 
dmiguelez
Core
No
0037882: Cannot add a purchase order line to a goods receipt if the Alternate UOM feature is activated after the order was created
Cannot add a purchase order line to a goods receipt if the Alternate UOM feature is activated after the order was created
As group admin role:
   Create a Purchase Order, add a product and book it

As System admin role:
   Set 'Enable UOM Management' preference to Y

As group admin role:
   Create a Goods Receipt header
   Click Create Lines From process and select the previously created order
   The following error message is shown:
      ERROR: null value in column "movementqty" violates not-null constraint
No tags attached.
related to defect 0038003 scheduled collazoandy4 Incorrect data adding a sales order line to a goods shipment if the AUM feature is activated after the order was created 
Issue History
2018-02-12 11:15ngarciaNew Issue
2018-02-12 11:15ngarciaAssigned To => Triage Finance
2018-02-12 11:15ngarciaModules => Core
2018-02-12 11:15ngarciaResolution time => 1520204400
2018-02-12 11:15ngarciaTriggers an Emergency Pack => No
2018-02-12 11:16ngarciaIssue Monitored: networkb
2018-02-14 15:26markmm82Assigned ToTriage Finance => markmm82
2018-02-14 15:49markmm82Statusnew => scheduled
2018-02-16 18:45markmm82Note Added: 0102471
2018-02-20 15:48markmm82Note Edited: 0102471bug_revision_view_page.php?bugnote_id=0102471#r16747
2018-02-26 19:16markmm82Note Edited: 0102471bug_revision_view_page.php?bugnote_id=0102471#r16776
2018-02-26 19:42markmm82Relationship addedrelated to 0038003
2018-02-27 09:21hgbotCheckin
2018-02-27 09:21hgbotNote Added: 0102846
2018-02-27 09:21hgbotStatusscheduled => resolved
2018-02-27 09:21hgbotResolutionopen => fixed
2018-02-27 09:21hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/38a4c363f9c8626b44b6feb32d28319a114ae7b1 [^]
2018-02-27 09:22dmiguelezReview Assigned To => dmiguelez
2018-02-27 09:22dmiguelezNote Added: 0102847
2018-02-27 09:22dmiguelezStatusresolved => closed
2018-02-27 09:22dmiguelezFixed in Version => 3.0PR18Q2
2018-02-27 11:05hgbotCheckin
2018-02-27 11:05hgbotNote Added: 0102848
2018-03-02 21:18hudsonbotCheckin
2018-03-02 21:18hudsonbotNote Added: 0102954
2018-03-02 21:18hudsonbotCheckin
2018-03-02 21:18hudsonbotNote Added: 0102955

Notes
(0102471)
markmm82   
2018-02-16 18:45   
(edited on: 2018-02-26 19:16)
Test Plan 1: Create Lines From Orders created before enable AUM in Goods Receipt and no AUM exists for used product.
As group admin role:
   Create a Purchase Order, add a product and book it

As System admin role:
   Set 'Enable UOM Management' preference to Y

As group admin role:
   Create a Goods Receipt header
   Click Create Lines From process and select the previously created order
   Notice the order line was copied successfully and it uses the UOM as AUM, and the UOMQTY as AUMQTY.


Test Plan 2: Create Lines From Invoices created before enable AUM in Goods Receipt and no AUM exists for used product.
As group admin role:
   Create a Purchase Invoice, add a product and book it

As System admin role:
   Set 'Enable UOM Management' preference to Y

As group admin role:
   Create a Goods Receipt header
   Click Create Lines From process and select the previously created invoice.
      Notice the AUM and AUM quantity was populated with the same than base as there are not AUM defined for the selected product.
   Done and Notice the invoice line was copied successfully and it uses the UOM as AUM, and the UOMQTY as AUMQTY.


Test Plan 3: Create Lines From Orders created before enable AUM in Goods Receipt and defined AUM for the used product.
As group admin role:
   Create a Purchase Order, add a product and book it

As System admin role:
   Set 'Enable UOM Management' preference to Y

As group admin role:
   Go to the Product window and select the product used in the Purchase Order previously created.
   Create an AUM between the uom of the product and for instance Kilogram unit with conversion rate = 10

   Create a Goods Receipt header
   Click Create Lines From process and select the previously created order
     Notice the AUM and AUM quantities has been calculated based on the base uom and the ordered quantity.
       Alternative UOM = Kilogram
       Operative Quantity = 1
       Movement Quantity = 10
       UOM = Unit.
   Notice the order line was copied successfully and it uses the Alternative UOM defined to the product and it calculates the AUMQTY based on it:
     Alternative UOM = Kilogram
     Operative Quantity = 1
     Movement Quantity = 10
     UOM = Unit.


Test Plan 4: Create Lines From Invoices created before enable AUM in Goods Receipt and defined AUM for the used product.
As group admin role:
   Create a Purchase Invoice, add a product and complete it

As System admin role:
   Set 'Enable UOM Management' preference to Y

As group admin role:
   Go to the Product window and select the product used in the Purchase Invoice previously created.
   Create an AUM between the uom of the product and for instance Kilogram unit with conversion rate = 10

   Create a Goods Receipt header
   Click Create Lines From process and select the previously created invoice
     Notice the AUM and AUM quantities has been calculated based on the base uom and the invoiced quantity.
       Alternative UOM = Kilogram
       Operative Quantity = 1
       Movement Quantity = 10
       UOM = Unit.
   Notice the invoice line was copied successfully and it uses the Alternative UOM defined to the product and it recalculates the AUMQTY based on it:
     Alternative UOM = Kilogram
     Operative Quantity = 1
     Movement Quantity = 10
     UOM = Unit.


Test Plan 5: Create Lines From Orders created after enable AUM in Goods Receipt and defined AUM for the used product.
As System admin role:
   Set 'Enable UOM Management' preference to Y

As group admin role:
   Go to the Product window and select Cerveza Ale 0,5L.
   Go to AUM tab and create a new record for Kilogram unit with conversion rate = 10
   Create a Purchase Order, add 1 operative quantity of a Cerveza Ale 0,5L product.
      Notice that Alternative UOM is Kilogram by default and Ordered quantity is 10.
   Book the order.

   Create a Goods Receipt header
   Click Create Lines From process and select the previously created order
     Notice the AUM and AUM quantities has been copied from the copied line.
       Alternative UOM = Kilogram
       Operative Quantity = 1
       Movement Quantity = 10
       UOM = Unit.
   Notice the order line also copies that info.


Test Plan 6: Create Lines From Invoices created after enable AUM in Goods Receipt and defined AUM for the used product.
As System admin role:
   Set 'Enable UOM Management' preference to Y

As group admin role:
   Go to the Product window and select Cerveza Ale 0,5L.
   Go to AUM tab and create a new record for Kilogram unit with conversion rate = 10
   Create a Purchase Invoice, add 1 operative quantity of a Cerveza Ale 0,5L product.
      Notice that Alternative UOM is Kilogram by default and Invoiced quantity is 10.
   Complete the invoice.

   Create a Goods Receipt header
   Click Create Lines From process and select the previously created invoice
     Notice the AUM and AUM quantities has been copied from the copied line.
       Alternative UOM = Kilogram
       Operative Quantity = 1
       Movement Quantity = 10
       UOM = Unit.
   Notice the invoice line also copies that info.

(0102846)
hgbot   
2018-02-27 09:21   
Repository: erp/devel/pi
Changeset: 38a4c363f9c8626b44b6feb32d28319a114ae7b1
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Feb 26 12:11:05 2018 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/38a4c363f9c8626b44b6feb32d28319a114ae7b1 [^]

Fixes issue 37882: Cannot add a purchase order line to a goods receipt if the
Alternate UOM feature is activated after the order was created.

If AUM is not enabled, when a purchase order is created it hasn't values in any of
the columns related with AUM. So, if the preference is activated after the order
creation, the ordered quantity will be used as AUMQTY and the UOM as AUM by default
when these order lines are copied to the receipt by the Create Lines From process and no
alternate units exists for the ordered product. In the case that alternate unit of
measure exists for the product the default AUM will be used as the receipt line AUM
and to calculate the operative quantity based on the conversion rate between the UOM and the AUM.

Were added to the XSQL file the return of the document type as C_DOCTYPE_ID field to use it when
the default AUM is calculated.

---
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql
---
(0102847)
dmiguelez   
2018-02-27 09:22   
Code Review + Testing Ok
(0102848)
hgbot   
2018-02-27 11:05   
Repository: erp/devel/pi
Changeset: 77881ff512166830fa32423bcae461efa51b6683
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Tue Feb 27 11:04:56 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/77881ff512166830fa32423bcae461efa51b6683 [^]

Related to Issue 37882. Adds new column in group by clause
to avoid problems in Oracle.

---
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql
---
(0102954)
hudsonbot   
2018-03-02 21:18   
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/05dece3dc80b [^]
Maturity status: Test
(0102955)
hudsonbot   
2018-03-02 21:18   
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/05dece3dc80b [^]
Maturity status: Test