Fixes issue 16791.
authorDavid Alsasua <david.alsasua@openbravo.com>
Thu, 28 Apr 2011 17:48:24 +0200
changeset 11803 53ddd0ec0d40
parent 11802 88493d62e8b9
child 11804 86dd7a035971
Fixes issue 16791.
Now, both ways -up and down- are followed to obtain the schemas that must create entry in the accounting tab of the warehouse
referencedata/sampledata/F_B_International_Group.xml
src-db/database/model/triggers/M_WAREHOUSE_TRG.xml
--- a/referencedata/sampledata/F_B_International_Group.xml	Thu Apr 28 19:50:03 2011 +0200
+++ b/referencedata/sampledata/F_B_International_Group.xml	Thu Apr 28 17:48:24 2011 +0200
@@ -84322,6 +84322,78 @@
     <fromDocumentNo xsi:nil="true"/>
     <toDocumentNo xsi:nil="true"/>
   </Warehouse>
+  <WarehouseAccounts id="FF8080812F9BABA8012F9C8775D300E8">
+    <id>FF8080812F9BABA8012F9C8775D300E8</id>
+    <warehouse id="DB499813C673490BAA6275D4BD2A5774"/>
+    <accountingSchema id="FF8080812AFBCB14012AFBD43E0B089A"/>
+    <client id="FF8080812AFBCB14012AFBD3E373001F"/>
+    <organization id="90A1F59849E84AFABD04814B3D15A691"/>
+    <active>true</active>
+    <warehouseInventory xsi:nil="true"/>
+    <inventoryAdjustment xsi:nil="true"/>
+    <warehouseDifferences id="FF8080812AFBCB14012AFBD44C3508B1"/>
+    <inventoryRevaluation xsi:nil="true"/>
+  </WarehouseAccounts>
+  <WarehouseAccounts id="FF8080812F9BABA8012F9C87CCF900EB">
+    <id>FF8080812F9BABA8012F9C87CCF900EB</id>
+    <warehouse id="DB499813C673490BAA6275D4BD2A5774"/>
+    <accountingSchema id="39BC4AF26E854FDF80AD7B9C5994148B"/>
+    <client id="FF8080812AFBCB14012AFBD3E373001F"/>
+    <organization id="90A1F59849E84AFABD04814B3D15A691"/>
+    <active>true</active>
+    <warehouseInventory xsi:nil="true"/>
+    <inventoryAdjustment xsi:nil="true"/>
+    <warehouseDifferences id="0E6B8B96D1F1483EA6C777CE7194F6F4"/>
+    <inventoryRevaluation xsi:nil="true"/>
+  </WarehouseAccounts>
+  <WarehouseAccounts id="FF8080812F9BABA8012F9C883D6400EF">
+    <id>FF8080812F9BABA8012F9C883D6400EF</id>
+    <warehouse id="9140844B5B404B7AA47E2DE3F3E6171C"/>
+    <accountingSchema id="39BC4AF26E854FDF80AD7B9C5994148B"/>
+    <client id="FF8080812AFBCB14012AFBD3E373001F"/>
+    <organization id="378AF0EAE1A2479EAAA33436645E9433"/>
+    <active>true</active>
+    <warehouseInventory xsi:nil="true"/>
+    <inventoryAdjustment xsi:nil="true"/>
+    <warehouseDifferences id="0E6B8B96D1F1483EA6C777CE7194F6F4"/>
+    <inventoryRevaluation xsi:nil="true"/>
+  </WarehouseAccounts>
+  <WarehouseAccounts id="FF8080812F9BABA8012F9C889AEF00F2">
+    <id>FF8080812F9BABA8012F9C889AEF00F2</id>
+    <warehouse id="9140844B5B404B7AA47E2DE3F3E6171C"/>
+    <accountingSchema id="FF8080812AFBCB14012AFBD43E0B089A"/>
+    <client id="FF8080812AFBCB14012AFBD3E373001F"/>
+    <organization id="378AF0EAE1A2479EAAA33436645E9433"/>
+    <active>true</active>
+    <warehouseInventory xsi:nil="true"/>
+    <inventoryAdjustment xsi:nil="true"/>
+    <warehouseDifferences id="FF8080812AFBCB14012AFBD44C3508B1"/>
+    <inventoryRevaluation xsi:nil="true"/>
+  </WarehouseAccounts>
+  <WarehouseAccounts id="FF8080812F9BABA8012F9C88ED5800F6">
+    <id>FF8080812F9BABA8012F9C88ED5800F6</id>
+    <warehouse id="3A66E12AA4664117A199B0B682930E6F"/>
+    <accountingSchema id="FF8080812AFBCB14012AFBD43E0B089A"/>
+    <client id="FF8080812AFBCB14012AFBD3E373001F"/>
+    <organization id="0D8E225ADA6E425E98EAA0F34E5912D7"/>
+    <active>true</active>
+    <warehouseInventory xsi:nil="true"/>
+    <inventoryAdjustment xsi:nil="true"/>
+    <warehouseDifferences id="FF8080812AFBCB14012AFBD44C3508B1"/>
+    <inventoryRevaluation xsi:nil="true"/>
+  </WarehouseAccounts>
+  <WarehouseAccounts id="FF8080812F9BABA8012F9C89175700FA">
+    <id>FF8080812F9BABA8012F9C89175700FA</id>
+    <warehouse id="71B43F2AAE3641CA849B131960BCEFF4"/>
+    <accountingSchema id="FF8080812AFBCB14012AFBD43E0B089A"/>
+    <client id="FF8080812AFBCB14012AFBD3E373001F"/>
+    <organization id="7A8E888A4B4C4E638CD5EB3A41A3289A"/>
+    <active>true</active>
+    <warehouseInventory xsi:nil="true"/>
+    <inventoryAdjustment xsi:nil="true"/>
+    <warehouseDifferences id="FF8080812AFBCB14012AFBD44C3508B1"/>
+    <inventoryRevaluation xsi:nil="true"/>
+  </WarehouseAccounts>
   <ADPreference id="0EC4DBB0AA6E46F897B2C61F83BEA0B9">
     <id>0EC4DBB0AA6E46F897B2C61F83BEA0B9</id>
     <client id="FF8080812AFBCB14012AFBD3E373001F"/>
--- a/src-db/database/model/triggers/M_WAREHOUSE_TRG.xml	Thu Apr 28 19:50:03 2011 +0200
+++ b/src-db/database/model/triggers/M_WAREHOUSE_TRG.xml	Thu Apr 28 17:48:24 2011 +0200
@@ -44,7 +44,8 @@
         (
       SELECT 1 
       FROM AD_Org_AcctSchema
-      WHERE AD_IsOrgIncluded(AD_Org_ID, :new.AD_ORG_ID, :new.AD_Client_ID)<>-1
+      WHERE (AD_IsOrgIncluded(AD_Org_ID, :new.AD_ORG_ID, :new.AD_Client_ID)<>-1
+          OR AD_IsOrgIncluded(:new.AD_Org_ID, AD_ORG_ID, :new.AD_Client_ID)<>-1)
       AND IsActive = 'Y'
       AND AD_Org_AcctSchema.C_AcctSchema_ID = d.C_AcctSchema_ID
         )