diff --git a/client/src/org/compiere/grid/ed/VPAttribute.java b/client/src/org/compiere/grid/ed/VPAttribute.java index 226994f264..05c9082eb6 100644 --- a/client/src/org/compiere/grid/ed/VPAttribute.java +++ b/client/src/org/compiere/grid/ed/VPAttribute.java @@ -371,7 +371,7 @@ public class VPAttribute extends JComponent { m_text.setText(vad.getM_AttributeSetInstanceName()); M_AttributeSetInstance_ID = vad.getM_AttributeSetInstance_ID(); - if (m_GridTab != null) + if (m_GridTab != null && !vad.isNew()) m_GridTab.setValue("M_Locator_ID", vad.getM_Locator_ID()); changed = true; } diff --git a/client/src/org/compiere/grid/ed/VPAttributeDialog.java b/client/src/org/compiere/grid/ed/VPAttributeDialog.java index f01c694869..cb85590b16 100644 --- a/client/src/org/compiere/grid/ed/VPAttributeDialog.java +++ b/client/src/org/compiere/grid/ed/VPAttributeDialog.java @@ -138,6 +138,8 @@ public class VPAttributeDialog extends CDialog private boolean m_productWindow = false; /** Change */ private boolean m_changed = false; + /** Was New ASI was created ? */ + private boolean m_newASI = false; private CLogger log = CLogger.getCLogger(getClass()); /** Row Counter */ @@ -522,6 +524,7 @@ public class VPAttributeDialog extends CDialog else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) { m_changed = false; + m_newASI = false; m_M_AttributeSetInstance_ID = 0; m_M_Locator_ID = 0; dispose(); @@ -702,6 +705,7 @@ public class VPAttributeDialog extends CDialog m_masi.save (); m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID (); m_M_AttributeSetInstanceName = m_masi.getDescription(); + m_newASI = true; } // Save Instance Attributes @@ -791,6 +795,13 @@ public class VPAttributeDialog extends CDialog { return m_changed; } // isChanged + + /** + * @return true if new ASI was created + */ + public boolean isNew() { + return m_newASI; + } } // VPAttributeDialog