BF [ 2227901 ] MRP (Calculate Material Plan) fails if resource is empty
https://sourceforge.net/tracker/index.php?func=detail&aid=2227901&group_id=176962&atid=879332
This commit is contained in:
parent
e2dfc86d19
commit
d2daebe6d3
|
@ -19,6 +19,7 @@ package org.compiere.model;
|
|||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.util.CCache;
|
||||
|
||||
|
||||
|
@ -30,6 +31,7 @@ import org.compiere.util.CCache;
|
|||
*
|
||||
* @author Teo Sarca, www.arhipac.ro
|
||||
* <li>FR [ 2051056 ] MResource[Type] should be cached
|
||||
* <li>BF [ 2227901 ] MRP (Calculate Material Plan) fails if resource is empty
|
||||
*/
|
||||
public class MResource extends X_S_Resource
|
||||
{
|
||||
|
@ -130,6 +132,14 @@ public class MResource extends X_S_Resource
|
|||
m_product = new MProduct(this, getResourceType());
|
||||
m_product.saveEx(get_TrxName());
|
||||
}
|
||||
//
|
||||
// Validate Manufacturing Resource
|
||||
if (isManufacturingResource()
|
||||
&& MANUFACTURINGRESOURCETYPE_Plant.equals(getManufacturingResourceType())
|
||||
&& getPlanningHorizon() <= 0)
|
||||
{
|
||||
throw new AdempiereException("@"+COLUMNNAME_PlanningHorizon+"@ <= @0@ !");
|
||||
}
|
||||
return true;
|
||||
} // beforeSave
|
||||
|
||||
|
|
Loading…
Reference in New Issue