Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0042847Openbravo ERP04. Warehouse managementpublic2020-01-14 12:432020-01-20 12:39
gorkaion 
AtulOpenbravo 
immediatemajoralways
closedfixed 
5
 
3.0PR20Q2 
dmiguelez
Core
Production - Confirmed Stable
3.0PR19Q3
https://code.openbravo.com/erp/devel/pi/rev/e4ecb0f34be7fcdd0626f218bf39fe5573ea0fff [^]
No
0042847: Inventory Amount Update process tries to create Physical Inventories in organizations no trx allowed
The Inventory Amount Update process generates closing and init inventories to adjust the cost. These inventories as per fix of issue 0040539 are created on the organization where the warehouse adjusted is created.

If the warehouse is defined in a organization of type "Organization" that do not allow transaction the process fails. As it is trying to generate the Physical Inventories on that organization.

In this scenario it should search the first parent organization that allows transactions (business unit or legal entity) and generate the physical inventories on it.
On F&B client.

1. Create a new organization (name: Org A) child of F&B España, S.A of type Organization.
2. Create a new organization (name: Generic) child of "Org A" of type Generic.
3. Create a new warehouse (name: Test WH) on organization "Org A"
3. Create a new Product (name: Test) of type item and stocked.
4. Create a physical inventory to initialize the stock of the product "Test" on the warehouse "Test WH" set a cost of 10 EUR before processing the inventory.
5. Ensure that the coting background process is executed and that the transaction of the physical inventory is calculated.
6. Create a new Inventory Amount Update headed on "F&B España, S.A"
7. Create a new line of product "Test" and change the cost to 15.
8. Process the Inventory Amount Update.

The process fails as it is trying to create an inventory on the organization "Org A" which is not allowed.
In case the warehouse is defined on a organization that does not allow transactions the process should search the first parent organization that allow transactions and create the physical inventory on it.

This parent organization can be a Business Unit or the Legal Organization. Initialize a OrganziationStructureProvider and calculate the org as:
invOrg = osp.getLegalEntityOrBusinessUnit(closeInv.getWarehouse().getOrganization());
No tags attached.
depends on backport 00428683.0PR20Q1 closed AtulOpenbravo Inventory Amount Update process tries to create Physical Inventories in organizations no trx allowed 
depends on backport 00428693.0PR19Q4.2 closed AtulOpenbravo Inventory Amount Update process tries to create Physical Inventories in organizations no trx allowed 
depends on backport 00428703.0PR19Q3.4 closed AtulOpenbravo Inventory Amount Update process tries to create Physical Inventories in organizations no trx allowed 
caused by defect 0040539 closed nonofrancisco Physical inventory transactions are always created at legal level 
related to defect 0042994 closed AtulOpenbravo Validating a new costing rule is trying to create physical inventories in organizations where transactions are not allowed 
Issue History
2020-01-14 12:43gorkaionNew Issue
2020-01-14 12:43gorkaionAssigned To => Triage Finance
2020-01-14 12:43gorkaionModules => Core
2020-01-14 12:43gorkaionResolution time => 1580770800
2020-01-14 12:43gorkaionRegression level => Production - Confirmed Stable
2020-01-14 12:43gorkaionRegression introduced in release => 3.0PR19Q3
2020-01-14 12:43gorkaionRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/e4ecb0f34be7fcdd0626f218bf39fe5573ea0fff [^]
2020-01-14 12:43gorkaionTriggers an Emergency Pack => No
2020-01-14 12:43gorkaionIssue generated from0040539
2020-01-14 12:43gorkaionRelationship addedcaused by 0040539
2020-01-14 12:53eugeniIssue Monitored: eugeni
2020-01-14 13:20dmiguelezAssigned ToTriage Finance => AtulOpenbravo
2020-01-14 16:48AtulOpenbravoStatusnew => scheduled
2020-01-15 20:13AtulOpenbravoNote Added: 0116909
2020-01-16 17:28AtulOpenbravoNote Added: 0116947
2020-01-20 12:37hgbotCheckin
2020-01-20 12:37hgbotNote Added: 0117064
2020-01-20 12:37hgbotStatusscheduled => resolved
2020-01-20 12:37hgbotResolutionopen => fixed
2020-01-20 12:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d5b685223e5e2e6a6b9bd9773abf3afb921576cc [^]
2020-01-20 12:37hgbotCheckin
2020-01-20 12:37hgbotNote Added: 0117065
2020-01-20 12:39dmiguelezReview Assigned To => dmiguelez
2020-01-20 12:39dmiguelezNote Added: 0117069
2020-01-20 12:39dmiguelezStatusresolved => closed
2020-01-20 12:39dmiguelezFixed in Version => 3.0PR20Q2
2020-01-24 10:50ngarciaRelationship addedrelated to 0042994

Notes
(0116909)
AtulOpenbravo   
2020-01-15 20:13   
Test Plan

Login with F&B International Group Admin.

- Using Initial Organization Setup, create a new organization (name: Org A) child of F&B España, S.A of type Organization.
- Navigate to Organization window, select organization created in above step, set Summary Level = Yes, Set it as Ready.
- Using Initial Organization setup, Create a new organization (name: Generic) child of "Org A" of type Generic.
- Navigate to Organization window, select above created organization, Set it as Ready
- Create a new warehouse (name: Test WH) on organization "Org A"
- Create a new Product (name: Test) of type item and stocked.
- Create a physical inventory to initialize the stock of the product "Test" on the warehouse "Test WH" set a cost of 10 EUR before processing the inventory.
- Ensure that the costing background process is executed and that the transaction of the physical inventory is calculated.
- Create a new Inventory Amount Update headed on "F&B España, S.A"
- Create a new line of product "Test" and change the cost to 15.
- Process the Inventory Amount Update.
- Realize that process is completed successfully, Physical Inventory transactions for Inventory Amount Update Closing & Opening Inventory are created in Organization F&B España, S.A as this is organization in parent organization list of Org A having Org Type where Transactions are allowed.
(0116947)
AtulOpenbravo   
2020-01-16 17:28   
Login with F&B International Group Admin.

- Create a new warehouse (name: Test WH) in organization "F&B International Group Org" and create a Storage Bin under it.
- Create a new Product (name: Test) of type item and stocked in same Org as above.
- Create a physical inventory in "F&B España, S.A" org to initialize the stock of the product "Test" in the warehouse "Test WH", set a cost of 10 EUR before processing the inventory.
- Ensure that the costing background process is executed and that the transaction of the physical inventory is calculated.
- Create a new Inventory Amount Update headed on "F&B España, S.A"
- Create a new line of product "Test" and change the cost to 15.
- Process the Inventory Amount Update.
- Realize that process is completed successfully, Physical Inventory transactions for Inventory Amount Update Closing & Opening Inventory are created in Organization F&B España, S.A. (Is the one referred from Inventory Line)
(0117064)
hgbot   
2020-01-20 12:37   
Repository: erp/devel/pi
Changeset: d5b685223e5e2e6a6b9bd9773abf3afb921576cc
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Thu Jan 16 21:48:26 2020 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/d5b685223e5e2e6a6b9bd9773abf3afb921576cc [^]

Fixes BUG-42847:Inventory Amount Update process tries to create
Physical Inventories in organizations no trx allowed

**Use Organization from the Parent list of Warehouse Organization
whose organization type has transaction allowed flag set as Yes,
if no such organization is found, the use Organization from the
Inventory Line.

---
M src/org/openbravo/costing/InventoryAmountUpdateProcess.java
---
(0117065)
hgbot   
2020-01-20 12:37   
Repository: erp/devel/pi
Changeset: b9b21fcb80bc02e73b84bdb4b21095c2116754a5
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Mon Jan 20 11:37:25 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b9b21fcb80bc02e73b84bdb4b21095c2116754a5 [^]

Related to ISSUE-42847: Code Review Changes.

* Added final modifier to variables and parameters
* Extracted code to it's own method to improve redability

---
M src/org/openbravo/costing/InventoryAmountUpdateProcess.java
---
(0117069)
dmiguelez   
2020-01-20 12:39   
Code Review + Testing Ok