Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020131Openbravo ERP05. Production managementpublic2012-03-06 13:072012-04-12 10:24
malsasua 
jecharri 
highmajoralways
closedfixed 
20Community Appliance
2.50MP40 
2.50MP41 
Google Chrome
Core
No
0020131: wrong code in mrp_run_initialize process
When a purchase order line, the schedule delivery date is null , error is returned:
null value in column "qty" violates not-null constraint

It is generated because in mrp_run_initialize process, in cursor Cur_OrderLine, in the cursor query, the call to the process Mrp_Check_Planningmethod in the zone "select" is distinct to call in the zone "where":
in the zone "where", the third parameter of Mrp_Check_Planningmethod process is
 TO_NUMBER(COALESCE(ol.DatePromised, ol.DateOrdered, o.DateOrdered) - p_PlanningDate)
and in the zone "select" the third parameter is
TO_NUMBER(ol.DatePromised - p_PlanningDate)
this should be equal to previous:
 TO_NUMBER(COALESCE(ol.DatePromised, ol.DateOrdered, o.DateOrdered) - p_PlanningDate)
. create purchase order line without schedule delivery date
. run process purchase plan
change in zone "select", in call to process Mrp_Check_Planningmethod, the third parameter from
TO_NUMBER(ol.DatePromised - p_PlanningDate)
to
TO_NUMBER(COALESCE(ol.DatePromised, ol.DateOrdered, o.DateOrdered) - p_PlanningDate)
No tags attached.
blocks defect 00199573.0MP10 closed jecharri wrong code in mrp_run_initialize process 
Issue History
2012-03-28 09:25jecharriTypedefect => backport
2012-03-28 09:25jecharrifix_in_branch => 2.50
2012-03-28 09:26jecharriWeb browserGoogle Chrome => Google Chrome
2012-03-28 09:26jecharriversionpi => 2.50MP40
2012-03-28 09:26jecharriTarget Version3.0MP10 => 2.50MP41
2012-03-28 09:42hgbotCheckin
2012-03-28 09:42hgbotNote Added: 0046797
2012-03-28 09:42hgbotStatusscheduled => resolved
2012-03-28 09:42hgbotResolutionopen => fixed
2012-03-28 09:42hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/09e5d0020049826d1bc97b7a042d462e37f82179 [^] => http://code.openbravo.com/erp/stable/2.50/rev/2f9f33f0b923c1098e985858d98ead6a474b5f54 [^]
2012-04-12 10:24malsasuaNote Added: 0047497
2012-04-12 10:24malsasuaStatusresolved => closed

Notes
(0046797)
hgbot   
2012-03-28 09:42   
Repository: erp/stable/2.50
Changeset: 2f9f33f0b923c1098e985858d98ead6a474b5f54
Author: Javier Etxarri <javier.echarri <at> openbravo.com>
Date: Wed Mar 28 09:41:47 2012 +0200
URL: http://code.openbravo.com/erp/stable/2.50/rev/2f9f33f0b923c1098e985858d98ead6a474b5f54 [^]

Fixes issue 20131: wrong code in mrp_run_initialize process

---
M src-db/database/model/functions/MRP_RUN_INITIALIZE.xml
---
(0047497)
malsasua   
2012-04-12 10:24   
revision: 2.50.19850
functionality: OK
code: OK