diff --git a/base/src/org/compiere/model/MProduct.java b/base/src/org/compiere/model/MProduct.java index cc3d4bbec8..e6efb5d23e 100644 --- a/base/src/org/compiere/model/MProduct.java +++ b/base/src/org/compiere/model/MProduct.java @@ -610,6 +610,19 @@ public class MProduct extends X_M_Product if (m_precision != null && is_ValueChanged("C_UOM_ID")) m_precision = null; + // AttributeSetInstance reset + if (is_ValueChanged(COLUMNNAME_M_AttributeSet_ID)) + { + MAttributeSetInstance asi = new MAttributeSetInstance(getCtx(),getM_AttributeSetInstance_ID(), get_TrxName()); + setM_AttributeSetInstance_ID(0); + // Delete the old m_attributesetinstance + if (!asi.delete(true, get_TrxName())) + { + log.saveError("Error", "Error deleting the AttributeSetInstance"); + return false; + } + } + return true; } // beforeSave