Fixed bug 28698: Not possible to remove variants, right after creation process.
authorReinaldo Guerra <reinaldo.guerra@peoplewalking.com>
Fri, 30 Jan 2015 19:43:37 -0500
changeset 25785 a0bbb21686cf
parent 25784 24c1d9df4b88
child 25842 636ee4259003
Fixed bug 28698: Not possible to remove variants, right after creation process.

The validation for existent values associated with product's characteristics was removed to make possible to delete a product variant. So now it is possible to delete the product (variant of another product) unless this product is already in use. In this case the standard message will be shown.
src/org/openbravo/event/ProductCharacteristicEventHandler.java
--- a/src/org/openbravo/event/ProductCharacteristicEventHandler.java	Mon Feb 02 17:32:26 2015 +0100
+++ b/src/org/openbravo/event/ProductCharacteristicEventHandler.java	Fri Jan 30 19:43:37 2015 -0500
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013-2014 Openbravo SLU
+ * All portions are Copyright (C) 2013-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -64,11 +64,6 @@
       return;
     }
     final ProductCharacteristic prCh = (ProductCharacteristic) event.getTargetInstance();
-    for (ProductCharacteristicValue pChV : prCh.getProduct().getProductCharacteristicValueList()) {
-    	if (pChV.getCharacteristic().equals(prCh.getCharacteristic())) {
-    		throw new OBException(OBMessageUtils.messageBD("DeleteProductChWithValue"));
-    	}
-    }
     if (prCh.isVariant() && prCh.getProduct().isGeneric()
         && !prCh.getProduct().getProductGenericProductList().isEmpty()) {
       throw new OBException(OBMessageUtils.messageBD("DeleteVariantChWithVariantsError"));