Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037317Openbravo ERP04. Warehouse managementpublic2017-11-17 09:532018-01-03 12:39
ngarcia 
nonofrancisco 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q1 
dmiguelez
Core
No
0037317: Costing Background Process stopped if the same product is produced and consumed in different production run of same work effort
Costing Background Process stopped if the same product is produced and consumed in different production run of same work effort
As group admin role:
   Create three products and set them as Production:
      RawMaterial
      WIP
      Final
   Set a Storage Bin for WIP and Final
   Add a purchase price list to RawMaterial and increase its stock
   Create a Manufacturing Cost Center and version
   Create an Activity and assign the previous Cost Center
   Create a Process Plan and Version
   Add two Operations to it
      Set RawMaterial as P- and WIP as P+ in first operation
      Set WIP as P- and Final as P+ in second operation
   Create a Work Requirement and process it
   Create a Work Effort
   Add two Production Run to it, one for each operation and set Completed Quantity
   Create Standards for both of them
   Validate it
   Launch the Costing Background Process and check the following error message is shown:
      java.lang.IllegalStateException: org.postgresql.util.PSQLException: ERROR: No average cost found for given product and date. Product: WIP, Date:...
No tags attached.
? work-effort.fix (5,877) 2017-11-21 18:40
https://issues.openbravo.com/file_download.php?file_id=11310&type=bug
Issue History
2017-11-17 09:53ngarciaNew Issue
2017-11-17 09:53ngarciaAssigned To => Triage Finance
2017-11-17 09:53ngarciaModules => Core
2017-11-17 09:53ngarciaResolution time => 1512687600
2017-11-17 09:53ngarciaTriggers an Emergency Pack => No
2017-11-17 09:54ngarciaIssue Monitored: networkb
2017-11-17 14:48nonofranciscoAssigned ToTriage Finance => nonofrancisco
2017-11-17 14:48nonofranciscoStatusnew => scheduled
2017-11-21 18:40ngarciaFile Added: work-effort.fix
2017-11-22 10:43ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16336#r16336
2017-11-23 09:53ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16347#r16347
2017-11-24 14:59nonofranciscoNote Added: 0100706
2017-11-30 12:34dmiguelezNote Added: 0100830
2017-11-30 12:36dmiguelezNote Edited: 0100830bug_revision_view_page.php?bugnote_id=0100830#r16409
2017-11-30 12:38dmiguelezNote Added: 0100831
2017-11-30 12:44hgbotCheckin
2017-11-30 12:44hgbotNote Added: 0100832
2017-11-30 12:44hgbotStatusscheduled => resolved
2017-11-30 12:44hgbotResolutionopen => fixed
2017-11-30 12:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4206e68ea96bcf6136b62a052c87895fcbd5905f [^]
2017-11-30 12:46dmiguelezReview Assigned To => dmiguelez
2017-11-30 12:46dmiguelezNote Added: 0100833
2017-11-30 12:46dmiguelezStatusresolved => closed
2017-11-30 12:46dmiguelezFixed in Version => 3.0PR18Q1
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101503

Notes
(0100706)
nonofrancisco   
2017-11-24 14:59   
As group admin role:
* Create three products and set them as Production:
    RawMaterial
    WIP
    Final
  Set a Storage Bin for WIP and Final

* Add a purchase price list to RawMaterial with price 3.00

* Create and complete a Goods Receipt for 5 units of product Raw Material

* Create a Manufacturing Cost Center and version

* Create an Activity and assign the previous Cost Center

* Create a Process Plan and Version
  Add two Operations to it
    Set RawMaterial as P- and WIP as P+ in first operation
    Set WIP as P- and Final as P+ in second operation

* Create a Work Requirement and process it

* Create a Work Effort
  Add two Production Run to it, one for each operation
  Set Completed Quantity
  Create Standards for both of them

* Validate the Work Effort

* Launch the Costing Background Process

* Verify the process completes successfully

* Select Costing tab of product RawMaterial and verify:
  Cost: 3.24
  Quantity: 5
  Total Stock Valuation: 16.2

* Select Costing tab of product WIP and verify there is a line with:
  Cost: 3.24
  Quantity: 1
  Total Stock Valuation: 3.24

* Select Costing tab of product Final and verify:
  Cost: 3.24
  Quantity: 1
  Total Stock Valuation: 3.24
(0100830)
dmiguelez   
2017-11-30 12:34   
(edited on: 2017-11-30 12:36)
As group admin role:
* Create three products and set them as Production:
    RawMaterial
    WIP
    Final
  Set a Storage Bin for WIP and Final

* Add a purchase price list to RawMaterial with price 10.00

* Create and complete a Goods Receipt for 10 units of product Raw Material

* Create a Manufacturing Cost Center and version

* Create an Activity and assign the previous Cost Center

* Create a Process Plan and Version
  Add two Operations to it
    Set RawMaterial as P- (2 units) and WIP as P+ (1 unit) in first operation
    Set WIP as P- (2 units) and Final as P+ (1 unit) in second operation

* Create a Work Requirement and process it

* Create a Work Effort
  Add two Production Run to it, one for each operation
  Set Completed Quantity (2 in the first case, 1 in the second)
  Create Standards for both of them

* Validate the Work Effort

* Launch the Costing Background Process

* Verify the process completes successfully

* Select Costing tab of product RawMaterial and verify:
  Cost: 10
  Quantity: 10
  Total Stock Valuation: 100

* Select Costing tab of product WIP and verify there is a line with:
  Cost: 20
  Quantity: 2
  Total Stock Valuation: 40
* Also, there should be another line, with same starting date and ending date, with no Production related to it and with Organization different from *. This is because this cost has been calculated with the old costing engine code.

* Select Costing tab of product Final and verify:
  Cost: 40
  Quantity: 1
  Total Stock Valuation: 40

(0100831)
dmiguelez   
2017-11-30 12:38   
As group admin role:
* Create four products and set them as Production:
    RawMaterial
    WIP1
    WIP2
    Final
  Set a Storage Bin for WIP and Final

* Add a purchase price list to RawMaterial with price 10.00

* Create and complete a Goods Receipt for 10 units of product Raw Material

* Create a Manufacturing Cost Center and version

* Create an Activity and assign the previous Cost Center

* Create a Process Plan and Version
  Add two Operations to it
    Set RawMaterial as P- (1 unit) and WIP1 as P+ (1 unit) in first operation
    Set WIP1 as P- (1 unit) and WIP2 as P+ (1 unit) in second operation
    Set WIP2 as P- (1 unit) and Final as P+ (1 unit) in second operation

* Create a Work Requirement and process it

* Create a Work Effort
  Add three Production Run to it, one for each operation
  Set Completed Quantity
  Create Standards for both of them

* Validate the Work Effort

* Launch the Costing Background Process

* Verify the process completes successfully

* Select Costing tab of product RawMaterial and verify:
  Cost: 10
  Quantity: 10
  Total Stock Valuation: 100

* Select Costing tab of product WIP1 and verify there is a line with:
  Cost: 10
  Quantity: 1
  Total Stock Valuation: 10
* Also, there should be another line, with same starting date and ending date, with no Production related to it and with Organization different from *. This is because this cost has been calculated with the old costing engine code.

* Select Costing tab of product WIP2 and verify there is a line with:
  Cost: 10
  Quantity: 1
  Total Stock Valuation: 10
* Also, there should be another line, with same starting date and ending date, with no Production related to it and with Organization different from *. This is because this cost has been calculated with the old costing engine code.

* Select Costing tab of product Final and verify:
  Cost: 10
  Quantity: 1
  Total Stock Valuation: 10
(0100832)
hgbot   
2017-11-30 12:44   
Repository: erp/devel/pi
Changeset: 4206e68ea96bcf6136b62a052c87895fcbd5905f
Author: Nono Carballo <nonofce <at> gmail.com>
Date: Thu Nov 30 10:44:40 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/4206e68ea96bcf6136b62a052c87895fcbd5905f [^]

Fixes issue 37317: Costing Background Process stopped if the same product is
produced and consumed in different production run of same work effort

If the product is not consumed by the same work effort, the costing server will
create/update the cost, otherwise, the cost is updated, to be taken into account
for the production run that consumes it.

This fix is a contribution of Support Team.

---
M src-db/database/model/functions/MA_PRODUCTION_COST.xml
---
(0100833)
dmiguelez   
2017-11-30 12:46   
Code Review + Testing Ok
(0101503)
hudsonbot   
2018-01-03 12:39   
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/c81e0d3cbab5 [^]
Maturity status: Test