IDEMPIERE-3107:Production (Light) system enable to complete production without end product
fix for IDEMPIERE-1750
This commit is contained in:
parent
3a0e748f1e
commit
153a3ea5e4
|
@ -104,14 +104,13 @@ public class MProduction extends X_M_Production implements DocAction {
|
||||||
StringBuilder errors = new StringBuilder();
|
StringBuilder errors = new StringBuilder();
|
||||||
int processed = 0;
|
int processed = 0;
|
||||||
|
|
||||||
|
if (!isUseProductionPlan()) {
|
||||||
|
MProductionLine[] lines = getLines();
|
||||||
//IDEMPIERE-3107 Check if End Product in Production Lines exist
|
//IDEMPIERE-3107 Check if End Product in Production Lines exist
|
||||||
if(!isHaveEndProduct(getLines())) {
|
if(!isHaveEndProduct(lines)) {
|
||||||
m_processMsg = "Production does not contain End Product";
|
m_processMsg = "Production does not contain End Product";
|
||||||
return DocAction.STATUS_Invalid;
|
return DocAction.STATUS_Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isUseProductionPlan()) {
|
|
||||||
MProductionLine[] lines = getLines();
|
|
||||||
errors.append(processLines(lines));
|
errors.append(processLines(lines));
|
||||||
if (errors.length() > 0) {
|
if (errors.length() > 0) {
|
||||||
m_processMsg = errors.toString();
|
m_processMsg = errors.toString();
|
||||||
|
@ -123,6 +122,13 @@ public class MProduction extends X_M_Production implements DocAction {
|
||||||
List<MProductionPlan> plans = planQuery.setParameters(getM_Production_ID()).list();
|
List<MProductionPlan> plans = planQuery.setParameters(getM_Production_ID()).list();
|
||||||
for(MProductionPlan plan : plans) {
|
for(MProductionPlan plan : plans) {
|
||||||
MProductionLine[] lines = plan.getLines();
|
MProductionLine[] lines = plan.getLines();
|
||||||
|
|
||||||
|
//IDEMPIERE-3107 Check if End Product in Production Lines exist
|
||||||
|
if(!isHaveEndProduct(lines)) {
|
||||||
|
m_processMsg = String.format("Production plan (line %1$d id %2$d) does not contain End Product", plan.getLine(), plan.get_ID());
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
}
|
||||||
|
|
||||||
if (lines.length > 0) {
|
if (lines.length > 0) {
|
||||||
errors.append(processLines(lines));
|
errors.append(processLines(lines));
|
||||||
if (errors.length() > 0) {
|
if (errors.length() > 0) {
|
||||||
|
|
Loading…
Reference in New Issue