# HG changeset patch
# User Augusto Mauch <augusto.mauch@openbravo.com>
# Date 1499089963 -7200
#      Mon Jul 03 15:52:43 2017 +0200
# Node ID 95e02e4f6ff45288a24ad921993f1371b146d52d
# Parent  159d036861e3a926aebe1cc2d8a20fbc40b0b18c
Fixes issue 36388: Do not export treenodes that are part of sourcedata

Now the entries of ad_treenode that reference the menu ad_tree (id '10') or the Primary Organization ad_tree (id '50', is the one where the root organization belongs) are not exported, to prevent those entried being imported twice.

diff --git a/src-db/database/sourcedata/AD_DATASET_TABLE.xml b/src-db/database/sourcedata/AD_DATASET_TABLE.xml
--- a/src-db/database/sourcedata/AD_DATASET_TABLE.xml
+++ b/src-db/database/sourcedata/AD_DATASET_TABLE.xml
@@ -1976,6 +1976,11 @@
 <!--CB76C93ACF38482B993A060252949353-->  <EXCLUDEAUDITINFO><![CDATA[N]]></EXCLUDEAUDITINFO>
 <!--CB76C93ACF38482B993A060252949353-->  <ISBUSINESSOBJECT><![CDATA[N]]></ISBUSINESSOBJECT>
 <!--CB76C93ACF38482B993A060252949353-->  <AD_MODULE_ID><![CDATA[C7EC0756A4044DD48BF6BB6A1CDD7734]]></AD_MODULE_ID>
+<!--CB76C93ACF38482B993A060252949353-->  <EM_STRSYNC_FULL_SQL_QUERY><![CDATA[select @selectClause@
+from ad_treenode tn
+inner join ad_tree t on t.ad_tree_id = tn.ad_tree_id
+where t.ad_tree_id not in ('10', '50') and @additionalFilters@   ]]></EM_STRSYNC_FULL_SQL_QUERY>
+<!--CB76C93ACF38482B993A060252949353-->  <EM_STRSYNC_ENTITY_ALIAS><![CDATA[tn]]></EM_STRSYNC_ENTITY_ALIAS>
 <!--CB76C93ACF38482B993A060252949353--></AD_DATASET_TABLE>
 
 <!--CC81249F77E4407CB123036F5816AF24--><AD_DATASET_TABLE>
