Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015139Openbravo ERP05. Production managementpublic2010-11-09 10:362010-12-21 00:00
xabiermerino 
sivaraman 
urgentmajoralways
closedfixed 
5
2.50MP23 
2.50MP25 
Core
No
0015139: Lack a constraint in the tables MA_Sequenceproduct and MA_Wrphaseproduct
We have a product with a secondary UOM.

In this moment is possible add a product with a secondary UOM in the Process Plan and the Work Requirement without select an Order Quantitu or an Order UOM.

This process fails when we want create standards in the Production Run. This is why the table M_Productionline has the constraint whule the tables MA_Sequenceproduct and MA_Wrphaseproduct do not have it.

The constraint is:

CONSTRAINT m_productionline_check1
CHECK ((quantityorder IS NULL) AND (m_product_uom_id IS NULL))
OR ((quantityorder IS NOT NULL) AND (m_product_uom_id IS NOT NULL))

The application should avoid that you can save an I/O product without Order UOM or without Quantity Order in the Process Plan.
- AS Openbravo Admin go to Master Data Management || Product
- Select Wood Slice and go to UOM:
     - UOM: Bag
- Go to Master Data Management || Product Setup || Unit of Measure and select Unit.
- Go to Conversion.
     - Create a new conversion:
            - To UOM_ Bag
            - Multiple Rate by: 3.

- Go to Production Management || Transactions || Process Plan
- Create a new Process Plan, a new version a new Operation.
- Create two I/O Products:
     - p-, Block of wood, quantity 1
     - P+, Wood Slice, ORder Quantity 5, Order UOM: empty, Quantity 5.
- Realize that you are able to save this record.

- Go to Production Management || Transactions || Work Requirement
- Create a new record and select the process plan created.
- Process the Work Requirement.
- Realize that you are able to do it.

- Go to Production Management || Transactions || Work Effort create a new record and a new production run:
    - Select the WR Phase created
- Click 'Create Standards'
- Realize that an error appears:
    
Error:
el nuevo registro para la relación «m_productionline» viola la restricción check «m_productionline_check1»

No tags attached.
Issue History
2010-11-09 10:36xabiermerinoNew Issue
2010-11-09 10:36xabiermerinoAssigned To => adrianromero
2010-11-09 10:36xabiermerinoIssue Monitored: networkb
2010-11-26 11:33sivaramanAssigned Toadrianromero => sivaraman
2010-11-26 12:57adrianromeroNote Added: 0032875
2010-12-01 13:56hgbotCheckin
2010-12-01 13:56hgbotNote Added: 0032979
2010-12-01 13:56hgbotStatusnew => resolved
2010-12-01 13:56hgbotResolutionopen => fixed
2010-12-01 13:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bcc76c8a4527ca7408d36c12ea87a31af2837cee [^]
2010-12-02 04:53hudsonbotCheckin
2010-12-02 04:53hudsonbotNote Added: 0032995
2010-12-02 07:18hgbotCheckin
2010-12-02 07:18hgbotNote Added: 0032996
2010-12-02 07:18hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/bcc76c8a4527ca7408d36c12ea87a31af2837cee [^] => http://code.openbravo.com/erp/devel/pi/rev/7b8b7e14465aeefcc539816b91336fdb33004b0e [^]
2010-12-02 07:42sivaramanNote Added: 0032998
2010-12-02 16:49hudsonbotCheckin
2010-12-02 16:49hudsonbotNote Added: 0033013
2010-12-20 17:42psarobeNote Added: 0033308
2010-12-20 17:42psarobeStatusresolved => closed
2010-12-21 00:00anonymoussf_bug_id0 => 3141007

Notes
(0032875)
adrianromero   
2010-11-26 12:57   
The proposal to fix the issue is a new constraint that it is actually an API change of Openbravo.

This API change has a medium risk and must be approved first. After approved it must be explained properly in the document http://wiki.openbravo.com/wiki/ERP/2.50/API_changes [^]

The explanation is that Process Plans and Work Requirements must be properly configured with fields quantity order and product uom both null or both not null. Actually this must be like this because in other case the process Create Standards fails.
(0032979)
hgbot   
2010-12-01 13:56   
Repository: erp/devel/pi
Changeset: bcc76c8a4527ca7408d36c12ea87a31af2837cee
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Wed Dec 01 18:25:23 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/bcc76c8a4527ca7408d36c12ea87a31af2837cee [^]

Fixes issue 15139: Lack a constraint in the tables MA_Sequenceproduct and MA_Wrphaseproduct

the following constrains have been added for both MA_SEQUENCEPRODUCT and MA_WRPHASEPRODUCT tables.

((QUANTITYORDER IS NULL) AND (M_PRODUCT_UOM_ID IS NULL)) OR ((QUANTITYORDER IS NOT NULL) AND (M_PRODUCT_UOM_ID IS NOT NULL))

Impacts:
None

---
M src-db/database/model/tables/MA_SEQUENCEPRODUCT.xml
M src-db/database/model/tables/MA_WRPHASEPRODUCT.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0032995)
hudsonbot   
2010-12-02 04:53   
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/bcc76c8a4527 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/36e9c0a1809f [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.19059.obx [^]
(0032996)
hgbot   
2010-12-02 07:18   
Repository: erp/devel/pi
Changeset: 7b8b7e14465aeefcc539816b91336fdb33004b0e
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Thu Dec 02 11:47:28 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/7b8b7e14465aeefcc539816b91336fdb33004b0e [^]

Fixes issue 15139: Lack a constraint in the tables MA_Sequenceproduct and MA_Wrphaseproduct

Error message has been modified as follows

Order Quantity and Order UOM are co-dependent fields. You cannot assign value for one field and leave other empty.

Impacts:
None

---
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0032998)
sivaraman   
2010-12-02 07:42   
Steps to test:

Kindly follow the steps as given in 'Steps To Reproduce' section and verify if error message is shown when I/O Products is saved with having value in Order Quantity and leaving Order UOM empty. Also verify the same with vice versa values.

The same expected behavior is also applicable for Work Requirement || Header >> Operation >> Product. Kindly verify that too.
(0033013)
hudsonbot   
2010-12-02 16:49   
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/7b8b7e14465a [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/dc020fc4156f [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.19064.obx [^]
(0033308)
psarobe   
2010-12-20 17:42   
Tested working fine