Fixes issue 35302: Updated the node's organization of the product category tree.
authorLuis <luisrs8608@gmail.com>
Mon, 06 Mar 2017 09:51:37 -0500
changeset 31610 43a3e127a044
parent 31609 ee35e34cd34b
child 31611 11a7d575cf55
Fixes issue 35302: Updated the node's organization of the product category tree.

When you change the organization of a product category, it is not changed from
the node of the product category tree. As consequence, categories are not shown
in webPOS.

To solve this, when the product category's organization is changed, the node's organization of the
product category tree is updated too.
src-db/database/model/triggers/M_PRODUCT_CATEGORY_TRG.xml
--- a/src-db/database/model/triggers/M_PRODUCT_CATEGORY_TRG.xml	Tue Mar 07 12:36:31 2017 +0100
+++ b/src-db/database/model/triggers/M_PRODUCT_CATEGORY_TRG.xml	Mon Mar 06 09:51:37 2017 -0500
@@ -17,7 +17,7 @@
     * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
     * All Rights Reserved.
     * Contributor(s): Openbravo SLU
-    * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
+    * Contributions are Copyright (C) 2001-2017 Openbravo, S.L.U.
     *
     * Specifically, this derivative work is based upon the following Compiere
     * file and version.
@@ -108,6 +108,17 @@
   ELSIF (UPDATING) THEN
     UPDATE M_PRODUCT_CATEGORY_ACCT SET AD_ORG_ID = :new.AD_ORG_ID
     WHERE M_PRODUCT_CATEGORY_ID = :new.M_PRODUCT_CATEGORY_ID;
+
+    SELECT c.AD_Tree_Product_Category_ID
+    INTO v_xTree_ID
+    FROM AD_ClientInfo c
+    WHERE c.AD_Client_ID=:new.AD_Client_ID;
+	
+    UPDATE AD_TREENODE
+    SET AD_ORG_ID = :new.AD_ORG_ID
+    WHERE AD_CLIENT_ID=:new.AD_Client_ID
+      AND AD_Tree_ID=v_xTree_ID
+      AND Node_ID=:new.M_Product_Category_ID;
   ELSIF (DELETING) THEN
     --  Delete TreeNode --
     --  get AD_Tree_ID