Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012758Openbravo ERP05. Production managementpublic2010-03-22 12:432010-05-20 00:00
adrianromero 
harikrishnan 
normalmajorhave not tried
closedfixed 
5
 
2.50MP17 
Core
No
0012758: Exception executing 'MA_PRODUCTIONRUN_STANDARD" when working with negative stocks
Working allowing negative stocks can raise an issue in the PL function "ma_productionrun_standard". In this function a "notenoughstocked" error is raised in line 340:

            IF (v_QtyAcumulated < v_DoneQuantity*Cur_WRPUsed.MovementQty) THEN
              v_Message := '@NotEnoughStocked@: ' || Cur_WRPUsed.pname;
            RAISE_APPLICATION_ERROR(-20000, v_Message);
            END IF;


In this block, instead or raising one exception it has to be checked if it is allowed in the client negative stock and if it is allowed then execute an extra insertion taking product stock from no matter what warehouse and no matter what attributes etc. When inserting this product stock info it also has to be checked the var "v_GlobalUse" to know if whether has to be inserted into the table "ma_global_use or in the "m_production line". And if it is not allowed negative stock then raise the exception.

Something similar to the previous logic is done in the function "m_inout_create" you can use as an example in the lines 466- .
* Testing of the issue:

To test the issue, follow the steps in the issue 12619 bugnotes.Test it two scenario one with set in the client Allow Negative=true and other one with false.

* Explanation of the changeset that fixes the issue:
The changeset that fix the issue consist of the insert statement in globaluse table and production line table if the client has set the allow negative stock =true.

* Other areas affected by the changeset:
No other areas are affected because apart from create standards button no other places this procedure is called.
No tags attached.
related to defect 00126192.50MP14 closed adrianromero Error when use 'Validate Work Effort' 
Issue History
2010-03-22 12:43adrianromeroNew Issue
2010-03-22 12:43adrianromeroAssigned To => adrianromero
2010-03-22 12:44adrianromeroRelationship addedrelated to 0012619
2010-03-23 10:59adrianromeroStatusnew => scheduled
2010-03-23 10:59adrianromerofix_in_branch => pi
2010-03-23 11:00adrianromeroTarget Version => 2.50MP15
2010-03-23 11:00adrianromerofix_in_branchpi =>
2010-05-01 08:43harikrishnanAssigned Toadrianromero => harikrishnan
2010-05-01 08:46hgbotCheckin
2010-05-01 08:46hgbotNote Added: 0026831
2010-05-01 08:46hgbotStatusscheduled => resolved
2010-05-01 08:46hgbotResolutionopen => fixed
2010-05-01 08:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cb7049cc054328459aec708756fe826841187353 [^]
2010-05-01 08:51harikrishnanNote Added: 0026832
2010-05-17 09:47psarobeSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=368#r368
2010-05-18 12:12gorka_gilTarget Version2.50MP15 => 2.50MP17
2010-05-18 21:43hudsonbotCheckin
2010-05-18 21:43hudsonbotNote Added: 0027469
2010-05-19 07:43arunkumarNote Added: 0027538
2010-05-19 07:43arunkumarStatusresolved => closed
2010-05-20 00:00anonymoussf_bug_id0 => 3004337

Notes
(0026831)
hgbot   
2010-05-01 08:46   
Repository: erp/devel/pi
Changeset: cb7049cc054328459aec708756fe826841187353
Author: Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
Date: Sat May 01 12:15:26 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/cb7049cc054328459aec708756fe826841187353 [^]

Fixes Issue 12758: Exception executing 'MA_PRODUCTIONRUN_STANDARD\" when working with negative stocks.

---
M src-db/database/model/functions/MA_PRODUCTIONRUN_STANDARD.xml
---
(0026832)
harikrishnan   
2010-05-01 08:51   
* Testing of the issue:

To test the issue, follow the steps in the issue 12619 bugnotes.Test it two scenario one with set in the client Allow Negative=true and other one with false.

* Explanation of the changeset that fixes the issue:
The changeset that fix the issue consist of the insert statement in globaluse table and production line table if the client has set the allow negative stock =true.

* Other areas affected by the changeset:
No other areas are affected because apart from create standards button no other places this procedure is called.
(0027469)
hudsonbot   
2010-05-18 21:43   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/cb7049cc0543 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/aa11838d5f80 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17380.obx [^]
(0027538)
arunkumar   
2010-05-19 07:43   
Tested working fine