Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032012Openbravo ERP04. Warehouse managementpublic2016-01-26 12:272016-07-20 11:36
VictorVillar 
aferraz 
urgentmajoralways
closedfixed 
5
pi 
3.0PR16Q23.0PR16Q2 
dmiguelez
Core
No
0032012: Not possible to either validate a costing rule or create an inventory amount update under some circumstancies
Not possible to either validate a costing rule or create an inventory amount update under some circumstancies
If the client was working with a Product A with uom: unit. Then remove the stock and change the unit of measure to pallet and create new warehouse transactions, having stock.
It will not be possible to validate a costing rule in the past defining an Starting date different than null. Error @DocUOMMismatch@ 60 when trying to process the closing inventory because the current product uom is different than the one that existed in the past.

Besides it could happen if a product has stock in 2 organizations and you allow negative stock. Example: one month ago you have:
Org A: 100 units
Org B: -100 units
You change the unit of measure to pallet.
Try to validate a costing rule for Org A. Error @DocUOMMismatch@ 60 when trying to process the closing inventory because the current product uom is different than the one that existed in the past.

Also it could happen creating an inventory amount update in the past with the same stock situation explained in the examples above.
Use a new column in the m_transaction in order not to take into account the unit of measure when you are creating closing and opening physical inventories.

Besides, it would be nice to review the trigger in the m_product in order to restrict properly the possibility to change the product's unit of measure by dimensions
No tags attached.
related to defect 00317723.0PR16Q2 closed aferraz Performance problem when you try to validate the costing rule with high volume of data 
related to defect 00339683.0PR17Q1 closed dmiguelez Wrong costs calculated with Backdated Transactions 
png Issue 32012_A.png (95,652) 2016-02-09 14:14
https://issues.openbravo.com/file_download.php?file_id=9041&type=bug
png

png Issue_32012_B.png (69,755) 2016-02-09 14:15
https://issues.openbravo.com/file_download.php?file_id=9042&type=bug
png
Issue History
2016-01-26 12:27VictorVillarNew Issue
2016-01-26 12:27VictorVillarAssigned To => Triage Finance
2016-01-26 12:27VictorVillarModules => Core
2016-01-26 12:27VictorVillarResolution time => 1454972400
2016-01-26 12:27VictorVillarTriggers an Emergency Pack => No
2016-01-26 12:27VictorVillarIssue Monitored: networkb
2016-01-27 09:24aferrazStatusnew => scheduled
2016-01-27 09:24aferrazAssigned ToTriage Finance => aferraz
2016-01-29 14:59aferrazRelationship addedrelated to 0031772
2016-02-09 12:25psanjuanNote Added: 0084051
2016-02-09 12:29psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11024
2016-02-09 12:38psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11025
2016-02-09 12:41psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11026
2016-02-09 12:45psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11027
2016-02-09 12:49psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11028
2016-02-09 12:53psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11029
2016-02-09 12:57psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11030
2016-02-09 13:02psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11031
2016-02-09 13:02psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11032
2016-02-09 13:06psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11033
2016-02-09 13:10psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11034
2016-02-09 14:11psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11035
2016-02-09 14:12psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11036
2016-02-09 14:12psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11037
2016-02-09 14:14psanjuanNote Edited: 0084051bug_revision_view_page.php?bugnote_id=0084051#r11038
2016-02-09 14:14psanjuanFile Added: Issue 32012_A.png
2016-02-09 14:15psanjuanFile Added: Issue_32012_B.png
2016-02-09 14:28psanjuanNote Added: 0084055
2016-02-10 10:14hgbotCheckin
2016-02-10 10:14hgbotNote Added: 0084074
2016-02-10 10:14hgbotStatusscheduled => resolved
2016-02-10 10:14hgbotResolutionopen => fixed
2016-02-10 10:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d74b9acdfd3c888a84ca59fb87a53687b8eba501 [^]
2016-02-10 10:15dmiguelezReview Assigned To => dmiguelez
2016-02-10 10:15dmiguelezNote Added: 0084075
2016-02-10 10:15dmiguelezStatusresolved => closed
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085123
2016-07-20 11:36aferrazRelationship addedrelated to 0033411
2016-07-20 11:36aferrazFixed in Version => 3.0PR16Q2
2016-07-20 11:37aferrazRelationship deletedrelated to 0033411
2016-09-16 13:40aferrazRelationship addedrelated to 0033411
2016-09-16 13:41aferrazRelationship deletedrelated to 0033411
2016-09-16 13:42aferrazRelationship addedrelated to 0033968

Notes
(0084051)
psanjuan   
2016-02-09 12:25   
(edited on: 2016-02-09 14:14)
Test Plan run locally (before applying the fix):

- As system Admin, go to Initial Client Setup and create a new client "Nuevo Cliente 32012"
- As "Nuevo Cliente 32012 Admin" go to Initial Organization Setup and create a new organization "legal with accounting". Name "F&B Pamplona". Currency EUR. Choose an accounting file.
- Go to Fiscal Calendar window and create a new one for *, with 2015 and 2016 year and their corresponding periods.
- Go to Warehouse and Storage bins window and create a warehouse for the org. Location Spain.
- Go to Organization window, select the org just created, set allow period control= yes, select the calendar, enter EUR as currency. Set the org as Ready. Select the Warehouse and enter Spain location.
- Go to Open/Close periods and open all periods.
- Create a price list schema and a sales&purchase price list, valid from 01-01-2015
- Create BP Category: customer, vendor
- Create product category: product
- Create a financial Account: Bank Nueva Org 32012
- Create a Payment Method: Transferencia. Set this payment method in the Financial Account.
- Create a Payment Terms: 30 d.
- Create a tax category: VAT Normal
- Create two tax rates related to that tax category: Sale and Purchase Tax rate, at a 21% rate. No info in Country/Destination Country.
- Create a vendor and a customer in the Business Partner window. located in Spain.
- Create a product in the Product window, named "Product A", Unit of Measure = Unit. Select purchase / sales price list in Price tab, enter any prices.
- Go to Unit of Measure window and create a new one named: EDI code = NA, Name = Synthetic pallet 80*120cm. Costing Precision = 4. Save.
- Dated on 15-03-2015 receipt 120 units of the product.
- Dated on 30-03-2015 ship 100 units of the product.
- Launch Stock Report dated on 30-03-2015. Verify stock is 20 units
- Dated on 15-04-2015 ship 20 units of the product.
- Launch Stock Report dated on 16-04-2015. Verify stock it is empty.
- Change unit of measure of the product to NA. Save. It is possible to change because there is no stock.
- Dated on 15-05-2015 receipt 50 pallets.
- Dated on 30-05-2015 ship 10 pallets.
- Launch Stock Report dated on 30-05-2015. Verify stock is 40 pallets.
- Go to costing rule window and create a new one for the org with below data:
Costing Algorithm = Average Algorithm
Starting Date = 10-04-2015
Press Validate costing rule.

An error is shown: see image attached.

(0084055)
psanjuan   
2016-02-09 14:28   
Test Plan run locally (after applying the fix):

- Go to costing rule window and try to validate the one created above with below data:
Costing Algorithm = Average Algorithm
Starting Date = 10-04-2015
Press Validate costing rule.

Check that the costing rule can be validated and two inventories have been created:
Closing Inventory = Quantity Count = 0; UOM = Unit; Book Quantity = 20
Opening Inventory = Quantity count = 20 ; UOM = UNit; Book Quantity= 0

Issue can be code reviewed and closed.
(0084074)
hgbot   
2016-02-10 10:14   
Repository: erp/devel/pi
Changeset: d74b9acdfd3c888a84ca59fb87a53687b8eba501
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jan 28 11:52:33 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d74b9acdfd3c888a84ca59fb87a53687b8eba501 [^]

Fixes issue 32012:Error when validating a costing rule under some circumstances

Update M_TRANSACTION_TRG to avoid raise @DocUOMMismatch@ error in case transaction has been created from a opening or closing inventory.

---
M src-db/database/model/triggers/M_TRANSACTION_TRG.xml
---
(0084075)
dmiguelez   
2016-02-10 10:15   
Code Review + Testing Ok
(0085123)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test