Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030232Openbravo ERP04. Warehouse managementpublic2015-06-23 13:302015-08-20 23:16
maite 
aferraz 
immediatecriticalalways
closedfixed 
5
 
3.0PR15Q4 
vmromanos
Core
No
0030232: Costing record not referencing any inventory transaction is created when processing Landed Cost document, under some circumstanc
Costing record not referencing any inventory transaction is created when processing Landed Cost document, under some circumstances
1. Create new product named "cost". Access Price tab and define price=2 for Bebidas Alegres pricelist
2. Register new Goods Receipt with:
  2.1 Line1: Product cost, unit=2, bin=0.0.0
  2.2 Line2: Product cost, unit=1, bin=1.0.0
Complete it and do not execute Costing Background.
3. Register Goods Shipment. Add line with 2 unit of product cost and bin 0.0.0
Complete it and do not execute Costing Background.
4. Void previous Goods Shipment.
5. Access Process Request window and run "Costing background". Realize that cost has been calculated for your product
6. Create new Landed Cost type referencing any gl item
7. Register new Landed Cost document.
  7.1 Access Cost tab and register new cost referencing previous Landed Cost type and setting amount=5 and currency EUR
  7.2 Access Cost tab and register new cost referencing previous Landed Cost type and setting amount=55 and currency MXN
  7.3 Access Receipt tab and select previous goods receipt
  7.4 Process landed cost document
8. Access Product | Costing tab and realize that cost has been recalculated but also new register has been added not referencing any inventory transaction, which is wrong

Repeat the same steps but running "Costing Background" process after complete each transaction (steps 2, 3 and 4) and realize Product | Costing records are created correctly.
No tags attached.
Issue History
2015-06-23 13:30maiteNew Issue
2015-06-23 13:30maiteAssigned To => Triage Finance
2015-06-23 13:30maiteModules => Core
2015-06-23 13:30maiteResolution time => 1435183200
2015-06-23 13:30maiteTriggers an Emergency Pack => No
2015-06-23 13:30maiteIssue Monitored: networkb
2015-07-01 12:00aferrazAssigned ToTriage Finance => aferraz
2015-07-01 14:20aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8961#r8961
2015-07-01 15:02aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8962#r8962
2015-07-02 11:48aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8965#r8965
2015-07-02 11:57aferrazNote Added: 0078623
2015-07-06 12:14vmromanosStatusnew => scheduled
2015-07-06 13:50psanjuanNote Added: 0078674
2015-07-06 13:52psanjuanNote Edited: 0078674bug_revision_view_page.php?bugnote_id=0078674#r8983
2015-07-06 13:56hgbotCheckin
2015-07-06 13:56hgbotNote Added: 0078675
2015-07-06 13:56hgbotStatusscheduled => resolved
2015-07-06 13:56hgbotResolutionopen => fixed
2015-07-06 13:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fb92cb9bd2eb4a675e406427959197435267dbf3 [^]
2015-07-06 13:56vmromanosReview Assigned To => vmromanos
2015-07-06 13:56vmromanosStatusresolved => closed
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079473

Notes
(0078623)
aferraz   
2015-07-02 11:57   
Test plan:

Follow the steps to reproduce and realize in both cases Product | Costing records are created correctly, with no records with inventory transaction empty.
(0078674)
psanjuan   
2015-07-06 13:50   
(edited on: 2015-07-06 13:52)
Verified it is working OK.
In both cases product transactions are calculated OK, same us average product cost.

(0078675)
hgbot   
2015-07-06 13:56   
Repository: erp/devel/pi
Changeset: fb92cb9bd2eb4a675e406427959197435267dbf3
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Jul 03 11:08:17 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fb92cb9bd2eb4a675e406427959197435267dbf3 [^]

Fixes issue 30232: Costing record not referencing transaction

getRelatedTransactions method in AverageCostAdjustment.java was creating an HQL query with a wrong parenthesis. Because of that Order By clause did not appear in the query, what was causing wrong Costing entries.
Also, when this error happens, current costing will be updated with the new cost, instead of creating a new costing with a null transaction.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0079473)
hudsonbot   
2015-08-20 23:16   
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/8c91718397a5 [^]
Maturity status: Test