IDEMPIERE-2318 Null pointer exception when Product has not Attribute set configured and costing level is batch / fix MovementLine cannot be saved
This commit is contained in:
parent
ffee60df18
commit
ff3366bea9
|
@ -211,11 +211,11 @@ public class MMovementLine extends X_M_MovementLine
|
|||
// Mandatory Instance
|
||||
MProduct product = getProduct();
|
||||
if (getM_AttributeSetInstance_ID() == 0) {
|
||||
if (product != null && product.getAttributeSet()==null) {
|
||||
if (product != null && product.isASIMandatory(true)) {
|
||||
if (product.getAttributeSet()==null) {
|
||||
log.saveError("NoAttributeSet", product.getValue());
|
||||
return false;
|
||||
}
|
||||
if (product != null && product.isASIMandatory(true)) {
|
||||
if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, true /*outgoing*/)) {
|
||||
log.saveError("FillMandatory", Msg.getElement(getCtx(), COLUMNNAME_M_AttributeSetInstance_ID));
|
||||
return false;
|
||||
|
@ -231,12 +231,12 @@ public class MMovementLine extends X_M_MovementLine
|
|||
setM_AttributeSetInstanceTo_ID(getM_AttributeSetInstance_ID());
|
||||
}
|
||||
|
||||
if (product != null && product.getAttributeSet()==null) {
|
||||
if (product != null && product.isASIMandatory(false) && getM_AttributeSetInstanceTo_ID() == 0)
|
||||
{
|
||||
if (product.getAttributeSet()==null) {
|
||||
log.saveError("NoAttributeSet", product.getValue());
|
||||
return false;
|
||||
}
|
||||
if (product != null && product.isASIMandatory(false) && getM_AttributeSetInstanceTo_ID() == 0)
|
||||
{
|
||||
if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, false /*incoming*/)) {
|
||||
log.saveError("FillMandatory", Msg.getElement(getCtx(), COLUMNNAME_M_AttributeSetInstanceTo_ID));
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue