Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013959Openbravo ERP06. Material requirement planning (MRP)public2010-07-14 18:162010-07-27 15:41
networkb 
adrianromero 
urgentmajoralways
closedfixed 
5
2.50MP19 
2.50MP21 
Core
No
0013959: Error "division by zero" when processing Purchasing Plan
When trying to process a Purchasing Plan with a product with capacity=0 and not enough stock of this product, you get error "division by zero".
Treatment of this error should be done at least to indicate the product which is experiencing the problem and the reason.
Maybe could be something like:
"Product XXX has capacity 0. Please set a proper capacity and run the process again"
1.Material Requirement (MRP) || Setup || Planning Method || Header: create record. Go lines and create record:
  transaction type=pending sales order
  Weighting=1
2. Material Requirement (MRP) || Setup || Planner: create record
3. Master Data Management || Product || Product >> Purchasing : search for "Beer" product and set capacity=0
4. Master Data Management || Product || Product >> Org Specific : create new record setting your planner and planning method and capacity=0
5. Sales Management || Transactions || Sales Order || Header:create SO for Mcgiver with Scheduled Delivery Date=14/08/2010
Go to Lines and set product=hat and qty=10000
Process SO.
6. Material Requirement (MRP) || Transactions || Purchasing Plan || Header:
  document date= 14-07-2010
  time horizon=60
  planner=your_planner
  bp=mcgiver
and run "Process Purchase Plan"
No tags attached.
Issue History
2010-07-14 18:16networkbNew Issue
2010-07-14 18:16networkbAssigned To => adrianromero
2010-07-20 11:50adrianromeroStatusnew => scheduled
2010-07-20 11:50adrianromerofix_in_branch => pi
2010-07-22 18:24hgbotCheckin
2010-07-22 18:24hgbotNote Added: 0029482
2010-07-22 18:24hgbotStatusscheduled => resolved
2010-07-22 18:24hgbotResolutionopen => fixed
2010-07-22 18:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d24e1139ded8929d1dd929d1d0963740d6c11382 [^]
2010-07-22 18:27adrianromeroNote Added: 0029483
2010-07-23 08:11sureshbabuNote Added: 0029490
2010-07-23 08:11sureshbabuStatusresolved => closed
2010-07-24 00:00anonymoussf_bug_id0 => 3033814
2010-07-27 15:41hudsonbotCheckin
2010-07-27 15:41hudsonbotNote Added: 0029599

Notes
(0029482)
hgbot   
2010-07-22 18:24   
Repository: erp/devel/pi
Changeset: d24e1139ded8929d1dd929d1d0963740d6c11382
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Thu Jul 22 18:22:49 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d24e1139ded8929d1dd929d1d0963740d6c11382 [^]

Fixes issue 0013959: Error division by zero when processing Purchasing Plan
It has been added a check that verifies when the capacity is zero and raises an error message explaining it

---
M src-db/database/model/functions/MRP_PURCHASEPLAN.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0029483)
adrianromero   
2010-07-22 18:27   
* Testing the issue

Follow the steps to test and verify that the process is interrupted and the following error message is displayed:

The following product has capacity 0. Please set a proper capacity and run the process again: Hat

* Other areas affected

It only has been modified the procedure MRP_PURCHASEPLAN and only the behavior when the capacity is zero. no other areas affected.
(0029490)
sureshbabu   
2010-07-23 08:11   
verified, system throws following error message
Error:
The following product has capacity 0. Please set a proper capacity and run the process again: test2
(0029599)
hudsonbot   
2010-07-27 15:41   
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/d24e1139ded8 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/634cc0909ed2 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17922.obx [^]