# HG changeset patch
# User Prakash M <prakash@qualiantech.com>
# Date 1585979808 -19800
#      Sat Apr 04 11:26:48 2020 +0530
# Node ID 1e76636d47ca8d4b81319511abdbd01fbd14bc62
# Parent  c10b4e25abb77408cd3fedd3bebcf35e250aab5b
Fixed BUG-43543: Fixes ProductCharacteristicValue does not finish on incremental

diff -r c10b4e25abb7 -r 1e76636d47ca src-db/database/model/triggers/OBPOS_PRODUCT_CH_VALUE_TRG.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/OBPOS_PRODUCT_CH_VALUE_TRG.xml	Sat Apr 04 11:26:48 2020 +0530
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER OBPOS_PRODUCT_CH_VALUE_TRG">
+    <trigger name="OBPOS_PRODUCT_CH_VALUE_TRG" table="M_PRODUCT_CH_VALUE" fires="after" insert="true" update="true" delete="false" foreach="row">
+      <body><![CDATA[
+    /*************************************************************************
+    * The contents of this file are subject to the Compiere Public
+    * License 1.1 ("License"); You may not use this file except in
+    * compliance with the License. You may obtain a copy of the License in
+    * the legal folder of your Openbravo installation.
+    * Software distributed under the License is distributed on an
+    * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+    * implied. See the License for the specific language governing rights
+    * and limitations under the License.
+    * The Original Code is  Compiere  ERP &  Business Solution
+    * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
+    * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
+    * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
+    * All Rights Reserved.
+    * Contributor(s): Openbravo SLU
+    * Contributions are Copyright (C) 2020 Openbravo, S.L.U.
+    ************************************************************************/
+  			
+BEGIN
+  IF AD_isTriggerEnabled()='N' THEN RETURN;
+  END IF;
+
+  IF (INSERTING OR UPDATING) THEN
+    UPDATE M_PRODUCT SET Updated=:new.Updated, UpdatedBy=:new.UpdatedBy 
+    WHERE M_PRODUCT_ID = :new.M_PRODUCT_ID;
+  END IF;
+ 
+END OBPOS_PRODUCT_CH_VALUE_TRG
+]]></body>
+    </trigger>
+  </database>
diff -r c10b4e25abb7 -r 1e76636d47ca src/org/openbravo/retail/posterminal/master/ProductCharacteristicValue.java
--- a/src/org/openbravo/retail/posterminal/master/ProductCharacteristicValue.java	Sat Apr 04 11:09:05 2020 +0530
+++ b/src/org/openbravo/retail/posterminal/master/ProductCharacteristicValue.java	Sat Apr 04 11:26:48 2020 +0530
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2015-2019 Openbravo S.L.U.
+ * Copyright (C) 2015-2020 Openbravo S.L.U.
  * Licensed under the Openbravo Commercial License version 1.0
  * You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
  * or in the legal folder of this module distribution.
@@ -151,10 +151,7 @@
         query.append(" and characteristicValue.$incrementalUpdateCriteria)");
       } else {
         query.append(" and (opp.$incrementalUpdateCriteria");
-        query.append(" or ppp.$incrementalUpdateCriteria");
-        query.append(" or pcv.$incrementalUpdateCriteria");
-        query.append(" or characteristic.$incrementalUpdateCriteria");
-        query.append(" or characteristicValue.$incrementalUpdateCriteria)");
+        query.append(" or product.$incrementalUpdateCriteria)");
       }
     }
     query.append(" order by pcv.id");
