Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0004459Openbravo ERP06. Material requirement planning (MRP)public2008-07-18 19:062008-07-22 11:04
mrp02000 
cromero 
normalminoralways
closedduplicate 
5
2.35MP5 
 
No
Core
No
0004459: Error in function mrp_workrequirement?
After processing a manufacturing plan and attempting to create the suggested work requirements, the process fails with the report:

"null value in column "ma_workrequirement_id" violates not-null constraint"

No work requirements are created. Line 79 of the function mrp_workrequirement reads:

SELECT * INTO v_WR_ID FROM Ad_Sequence_Next('MRP_WorkRequirement', v_User_ID);

seemingly passing the table mrp_workrequirement to the ad_sequence_next function. If the function is changed so that the table ma_workrequirement is passed instead, work requirements can be generated from the manufacturing plan, and show up in the appropriate transaction area.
Using the Openbravo online demo, create a planner and planning method for one of the products with a process plan. Create a sales order or forecast to generate demand, create a manufacturing plan, and process it. Verify that work requirements are suggested in the Lines tab. Attempt to create the material and work requirements.
For me, changing line 79 in the function as described fixed the problem.
No tags attached.
duplicate of backport 0004105 closed gorkaion Error in MRP_WORKREQUIREMENT.xml function 
Issue History
2008-07-18 19:06mrp02000New Issue
2008-07-18 19:06mrp02000Assigned To => cromero
2008-07-18 19:06mrp02000sf_bug_id0 => 2021650
2008-07-19 10:16joanNote Added: 0008338
2008-07-22 11:04cromeroRelationship addedduplicate of 0004105
2008-07-22 11:04cromeroStatusnew => closed
2008-07-22 11:04cromeroNote Added: 0008362
2008-07-22 11:04cromeroDuplicate ID0 => 4105
2008-07-22 11:04cromeroResolutionopen => duplicate

Notes
(0008338)
joan   
2008-07-19 10:16   
From -> https://issues.openbravo.com/view.php?id=4104 [^]

Repository: openbravo
Revision: 5263
Author: gorkaion
Date: 2008-06-20 17:53:41 +0200 (Fri, 20 Jun 2008)

Fixed bug 4104. Changed the call to AS_Sequence_Next function to correctly generate the new id.

---
U trunk/src-db/database/model/functions/MRP_WORKREQUIREMENT.xml
---

https://dev.openbravo.com/websvn/openbravo/?rev=5263&sc=1 [^] [^]

Isn't it fixed in last release?
(0008362)
cromero   
2008-07-22 11:04   
You are right and indeed it has been reported and fixed.
It will be included in next maintenance packs.