Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013629Openbravo ERP04. Warehouse managementpublic2010-06-11 17:042010-07-24 00:00
networkb 
sivaraman 
highmajoralways
closedfixed 
20Community Appliance
2.50MP18 
2.50MP20 
Core
No
0013629: in Bom Production, error "insuficient stock" is returned
Doing BOM Production, error "insuficient stock" is returned, and check "Product quantity must be on stock " is not checked.
Created a "Attribute Set" called "BatchNo" with "Require At Least One Value" control checkbox as ticked.

Created a "Attribute" called "BATCH-NO:" with "List" as ticked.

Created five values (BATCH-NO:1,BATCH-NO:2,BATCH-NO:3,BATCH-NO:4,BATCH-NO:5) under "Attribute Value" tab.

For "Attribute Set" "BatchNo", "Attribute" "BATCH-NO:" is assigned.

Created a Product "P1" with Bill of Materials checkbox ticked and "Attribute Set" as "BatchNo".

For Product "P1", Under "Bill of Materials" tab, created two BOM Products "ChemA" & "water" with "BOM Quantity" as 1 for each.

Created a Product "P2" with Bill of Materials checkbox ticked and "Attribute Set" as "BatchNo".

For Product "P2", Under "Bill of Materials" tab, created two BOM Products "P1" &
"WhiteAmpule" with "BOM Quantity" as 5 and 1 respectively.
============================
Following stock is available before running production P1 & P2.
ChemA - 1000 ml
Water - 2000 ml
WhiteAmpule - 100 unit
P1 - 0
P2 - 0
============================
Warehouse Management || Transactions || Bill of Materials Production || BOM
Production >> Production Plan >> I/O Products:

Created "BOM Production" for "P1" with 2 quantity.
And assigned a Attribute Set Value as "BATCH-NO:1" for "P1".
============================================================================================================
Stock Report after "P1" with 2 quantity.

Semi-finished products

Article Quantity Unit Attribute X Y Z Other Warehouse
ChemA-ChemA 998,00 ml 1 1 1 Main Warehouse
P1-P1 2,00 ml BATCH-NO:1 1 1 1 Main Warehouse
WhiteAmpule-WhiteAmpule 100,00 Unit 1 1 1 Main Warehouse

Supplies
Article Quantity Unit Attribute X Y Z Other Warehouse
water-Water 1.998,00 ml 1 1 1 Main Warehouse
============================================================================================================

Created "BOM Production" for "P1" with 5 quantity.
And assigned a Attribute Set Value as "BATCH-NO:2" for "P1".
============================================================================================================
Stock Report after "P1" with 5 quantity.

Semi-finished products

Article Quantity Unit Attribute X Y Z Other Warehouse
ChemA-ChemA 993,00 ml 1 1 1 Main Warehouse
P1-P1 2,00 ml BATCH-NO:1 1 1 1 Main Warehouse
P1-P1 5,00 ml BATCH-NO:2 1 1 1 Main Warehouse
WhiteAmpule-WhiteAmpule 100,00 Unit 1 1 1 Main Warehouse


Supplies

Article Quantity Unit Attribute X Y Z Other Warehouse
water-Water 1.993,00 ml 1 1 1 Main Warehouse
============================================================================================================
Created "BOM Production" for "P1" with 10 quantity.
And assigned a Attribute Set Value as "BATCH-NO:3" for "P1".
============================================================================================================
Stock Report after "P1" with 10 quantity.

Semi-finished products

Article Quantity Unit Attribute X Y Z Other Warehouse
ChemA-ChemA 983,00 ml 1 1 1 Main Warehouse
P1-P1 2,00 ml BATCH-NO:1 1 1 1 Main Warehouse
P1-P1 5,00 ml BATCH-NO:2 1 1 1 Main Warehouse
P1-P1 10,00 ml BATCH-NO:3 1 1 1 Main Warehouse
WhiteAmpule-WhiteAmpule 100,00 Unit 1 1 1 Main Warehouse


Supplies

Article Quantity Unit Attribute X Y Z Other Warehouse
water-Water 1.983,00 ml 1 1 1 Main Warehouse
============================================================================================================




Created "BOM Production" for "P2" with 1 quantity.
Here at this stage if I go to I/O Products tab and see, for "P1" input product,
system automatically picked-up Attribute Set Value "BATCH-NO:3".
Here I changed Attribute Set Value to "BATCH-NO:2" and saved.
Also I assigned Attribute Set Value "BATCH-NO:2" for "P2" and saved.
Now see the stck report....
============================================================================================================
Stock Report

Semi-finished products

Article Quantity Unit Attribute X Y Z Other Warehouse
ChemA-ChemA 983,00 ml 1 1 1 Main Warehouse
P1-P1 2,00 ml BATCH-NO:1 1 1 1 Main Warehouse
P1-P1 0,00 ml BATCH-NO:2 1 1 1 Main Warehouse
P1-P1 10,00 ml BATCH-NO:3 1 1 1 Main Warehouse
P2-P2 1,00 Unit BATCH-NO:2 1 1 1 Main Warehouse
WhiteAmpule-WhiteAmpule 99,00 Unit 1 1 1 Main Warehouse



Supplies

Article Quantity Unit Attribute X Y Z Other Warehouse
water-Water 1.983,00 ml 1 1 1 Main Warehouse
============================================================================================================

Created "BOM Production" for "P2" with 2 quantity.
Here at this stage if I go to I/O Products tab and see, for "P1" input product,
system automatically picked-up Attribute Set Value "BATCH-NO:3".
Here I changed Attribute Set Value to "BATCH-NO:1" and saved.
Also I assigned Attribute Set Value "BATCH-NO:1" for "P2" and saved.
============================================================================================================
Stock Report

Semi-finished products

Article Quantity Unit Attribute X Y Z Other Warehouse
ChemA-ChemA 983,00 ml 1 1 1 Main Warehouse
P1-P1 -8,00 ml BATCH-NO:1 1 1 1 Main Warehouse
P1-P1 0,00 ml BATCH-NO:2 1 1 1 Main Warehouse
P1-P1 10,00 ml BATCH-NO:3 1 1 1 Main Warehouse
P2-P2 2,00 Unit BATCH-NO:1 1 1 1 Main Warehouse
P2-P2 1,00 Unit BATCH-NO:2 1 1 1 Main Warehouse
WhiteAmpule-WhiteAmpule 97,00 Unit 1 1 1 Main Warehouse



Supplies

Article Quantity Unit Attribute X Y Z Other Warehouse
water-Water 1.983,00 ml 1 1 1 Main Warehouse
============================================================================================================
Created "BOM Production" for "P2" with 2 quantity.
If I go to BOM Production tab and click on "Create/Post Production" system
("Product quantity must be on stock " is not checked) throws error like "Insufficient stock:: P1".
change the line:
In database function "M_PRODUCTION_RUN", you should change the line
"AND COALESCE(T.QtyOnHand, 0)<>0" to text
"AND COALESCE(T.QtyOnHand, 0)>0"
in CUR_STOCK CURSOR.
No tags attached.
related to defect 0014298 closed Sandrahuguet BOM: option 'product quantity must be on stock' doesn't seem to affect the outcome when left blank 
Issue History
2010-06-11 17:04networkbNew Issue
2010-06-11 17:04networkbAssigned To => adrianromero
2010-06-16 13:07adrianromeroStatusnew => scheduled
2010-06-16 13:07adrianromerofix_in_branch => pi
2010-06-16 19:25networkbPrioritynormal => high
2010-06-16 19:25networkbfix_in_branchpi =>
2010-06-18 13:17networkbProposed Solution updated
2010-07-01 13:09sivaramanAssigned Toadrianromero => sivaraman
2010-07-01 13:09hgbotCheckin
2010-07-01 13:09hgbotNote Added: 0028946
2010-07-01 13:09hgbotStatusscheduled => resolved
2010-07-01 13:09hgbotResolutionopen => fixed
2010-07-01 13:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/90821df524aba222709e2b97f879991a3b96de10 [^]
2010-07-01 13:49sivaramanNote Added: 0028947
2010-07-02 14:51hudsonbotCheckin
2010-07-02 14:51hudsonbotNote Added: 0029003
2010-07-23 10:31psarobeNote Added: 0029504
2010-07-23 10:31psarobeStatusresolved => closed
2010-07-24 00:00anonymoussf_bug_id0 => 3033794
2012-03-20 13:50vmromanosRelationship addedrelated to 0014298

Notes
(0028946)
hgbot   
2010-07-01 13:09   
Repository: erp/devel/pi
Changeset: 90821df524aba222709e2b97f879991a3b96de10
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Thu Jul 01 16:37:14 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/90821df524aba222709e2b97f879991a3b96de10 [^]

Fixes issue 13629: in Bom Production, error \"insuficient stock\" is returned

AND clause has been modified in the corresponding stored procedure in order to make sure that it won't be able to complete the production if we don't have enough stock.

---
M src-db/database/model/functions/M_PRODUCTION_RUN.xml
---
(0028947)
sivaraman   
2010-07-01 13:49   
Steps to test:

Please follow the above steps as given in the Steps To Reproduce section and check if it throws "Insufficient stock" error. Also, verify if stocks are correct for each production complete.
(0029003)
hudsonbot   
2010-07-02 14:51   
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/90821df524ab [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/8fd5a427789e [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17797.obx [^]
(0029504)
psarobe   
2010-07-23 10:31   
Verified by code review