Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036681Openbravo ERP05. Production managementpublic2017-08-21 15:072017-09-21 16:49
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q4 
aferraz
Core
No
0036681: Insufficient stock in Create Standards Process of Work Effort - Production Run tab if decimal quantities are consumed
Insufficient stock in Create Standards Process of Work Effort - Production Run tab if decimal quantities are consumed and the stock is not in the same locator

The problem is that in M_GET_STOCK_PARAM function v_Quantity variable does not accept decimals:

v_Quantity NUMERIC(10);

and the next records from M_STOCK_PROPOSED table are deleted in the following piece of code:

      IF (v_qtyaux <= 0) THEN
        DELETE FROM m_stock_proposed
        WHERE ad_pinstance_id = p_uuid
          AND (priority > cur_warehouse.priority
              OR isfinal = 'N');
        EXIT;
      END IF;
As group admin role:
   Create a new warehouse for F&B España Region Norte
   Add a locator to it
   Increase its Relative Priority to 100
   Assign it as on hand warehouse to F&B España Region Norte organization

   Create a new product: consumed
   Set it as production
   Add 4 units of it in Region Norte warehouse
   Add more units of it in the new created warehouse

   Create a new product: produced
   Set it as production
   Create a record in Manufacturing tab for España Norte org and any locator

   Create an Activity
   Create a Process Plan, Version and Operation
   Set Create Standards to 'N'
   Add 4.4 units of the previously created product to be consumed (P-)
   Add 1 unit of the previously created product to be produced (P+)

   Create a Work Requirement for that Process Plan and process it (Quantity: 1)
   Create Work Effort
   Go to Work Effort - Production Run tab, set Completed Quantity to 1 and Create Standards
   You will get the following error:
      Insufficient stock:: <productName>
No tags attached.
related to defect 0036690 closed markmm82 Insufficient stock in Create Standards Process of Work Effort - Production Run tab if stock is in different priority warehouses 
Issue History
2017-08-21 15:07ngarciaNew Issue
2017-08-21 15:07ngarciaAssigned To => Triage Finance
2017-08-21 15:07ngarciaModules => Core
2017-08-21 15:07ngarciaResolution time => 1505080800
2017-08-21 15:07ngarciaTriggers an Emergency Pack => No
2017-08-21 15:09ngarciaDescription Updatedbug_revision_view_page.php?rev_id=15662#r15662
2017-08-21 15:09ngarciaIssue Monitored: networkb
2017-08-22 08:49aferrazAssigned ToTriage Finance => markmm82
2017-08-22 12:58ngarciaIssue cloned0036690
2017-08-22 12:59ngarciaRelationship addedrelated to 0036690
2017-08-22 13:00ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15669#r15669
2017-08-23 23:56markmm82Statusnew => scheduled
2017-08-24 20:05markmm82Note Added: 0098637
2017-08-25 12:01aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15719#r15719
2017-08-25 12:03hgbotCheckin
2017-08-25 12:03hgbotNote Added: 0098650
2017-08-25 12:03hgbotStatusscheduled => resolved
2017-08-25 12:03hgbotResolutionopen => fixed
2017-08-25 12:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d66d496bf11717dd0e50bdb729b0b74fdd61e5fb [^]
2017-08-25 12:03aferrazReview Assigned To => aferraz
2017-08-25 12:03aferrazNote Added: 0098651
2017-08-25 12:03aferrazStatusresolved => closed
2017-08-25 12:03aferrazFixed in Version => 3.0PR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099330

Notes
(0098637)
markmm82   
2017-08-24 20:05   
Test Plan 1:

As group admin role:
   Create a new warehouse for F&B España Region Norte
   Add a locator to it
   Increase its Relative Priority to 100
   Assign it as on hand warehouse to F&B España Region Norte organization

   Create a new product: consumed
   Set it as production
   Add 4 units of it in Region Norte warehouse
   Add more units of it in the new created warehouse

   Create a new product: produced
   Set it as production
   Assign a locator to it in the Manufacturing tab

   Create an Activity
   Create a Process Plan, Version and Operation
   Set Create Standards to 'N'
   Add 4.4 units of the previously created product to be consumed (P-)
   Add 1 unit of the previously created product to be produced (P+)

   Create a Work Requirement for that Process Plan and process it (Quantity: 1)
   Create Work Effort
   Go to Work Effort - Production Run tab, set Completed Quantity to 1
   Run Create Standards process.
   Notice it finishes successfully.
(0098650)
hgbot   
2017-08-25 12:03   
Repository: erp/devel/pi
Changeset: d66d496bf11717dd0e50bdb729b0b74fdd61e5fb
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Aug 24 13:14:38 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/d66d496bf11717dd0e50bdb729b0b74fdd61e5fb [^]

Fixes issue 36681: Insufficient stock in Create Standards Process of Work Effort

The problem was that in M_GET_STOCK_PARAM function v_Quantity variable does not
accept decimals and when quantity is decreased on iterations decimals are ignored
and the next records from M_STOCK_PROPOSED table are deleted.

To fix that, the v_Quantity variable has been declared as NUMBER to accept decimals.

---
M src-db/database/model/functions/M_GET_STOCK_PARAM.xml
---
(0098651)
aferraz   
2017-08-25 12:03   
Code review + Testing OK
(0099330)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test