Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0020294 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
defect | [Openbravo ERP] 09. Financial management | major | always | 2012-04-17 20:45 | 2015-05-13 17:08 | |||||||
Reporter | vmromanos | View Status | public | |||||||||
Assigned To | Triage Omni OMS | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | scheduled | Fix in branch | pi | Fixed in SCM revision | ||||||||
Projection | none | ETA | none | Target Version | ||||||||
OS | Linux 32 bit | Database | PostgreSQL | Java version | 1.6.0_12 | |||||||
OS Version | Debian 5.0 | Database version | 8.3.8 | Ant version | 1.7.0 | |||||||
Product Version | SCM revision | |||||||||||
Review Assigned To | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0020294: Updating Organization in Accounting Schema window | |||||||||||
Description | When updating the Organization in the header of the Accounting Schema window, this change is not propagated to the window tabs creating wrong data in the database. Example: 1. Run an Initial Org setup. Create org A with accounting 2. Run an Initial Org setup. Create org B with accounting 3. Go to Accounting Schema window. 4. Select A acct. schema and change its organization to B 5. See records in Accounting Schema Tables tab belong to A. (you should query the database, or display the organization field for this tab in the Application Dictionary) | |||||||||||
Steps To Reproduce | 1. Run an Initial Org setup. Create org A with accounting 2. Run an Initial Org setup. Create org B with accounting 3. Go to Accounting Schema window. 4. Select A acct. schema and change its organization to B 5. See records in Accounting Schema Tables tab belong to A. (you should query the database, or display the organization field for this tab in the Application Dictionary) | |||||||||||
Proposed Solution | Two possible solutions to be discussed: 1. Don't allow to modify organization field in the header 2. Propagate the change to the rest of the tabs in that window. Check whether this acct. schema is already use in the Org. Schema tab (Organization window) and this change makes sense for that configuration | |||||||||||
Tags | MIR-Reviewed | |||||||||||
Attached Files | bug_20294.diff [^] (40,252 bytes) 2015-05-13 17:08 [Show Content] [Hide Content]# HG changeset patch # User Naiara Martinez <naiara.martinez@openbravo.com> # Date 1337787154 -7200 # Node ID 3a3cc545e9edad510020226035f69c5fea45eb5b # Parent 9715e09221737aa448431bcd7c8d73f84697019c fixed bug 20294 Not allow updating org in Accounting Schema.Buildvalidation diff --git a/referencedata/sampledata/QA_Testing.xml b/referencedata/sampledata/QA_Testing.xml --- a/referencedata/sampledata/QA_Testing.xml +++ b/referencedata/sampledata/QA_Testing.xml @@ -226305,7 +226305,7 @@ <accountingSchema id="9A68A0F8D72D4580B3EC3CAA00A5E1F0"/> <table id="D4C23A17190649E7B78F55A05AF3438C"/> <client id="4028E6C72959682B01295A070852010D"/> - <organization id="0"/> + <organization id="43D590B4814049C6B85C6545E8264E37"/> <active>true</active> <createfactTemplate xsi:nil="true"/> <sQLDescription xsi:nil="true"/> @@ -226415,7 +226415,7 @@ <accountingSchema id="432EAC71E1B8451E97C7F54718C4A06B"/> <table id="D4C23A17190649E7B78F55A05AF3438C"/> <client id="4028E6C72959682B01295A070852010D"/> - <organization id="0"/> + <organization id="5EFF95EB540740A3B10510D9814EFAD5"/> <active>true</active> <createfactTemplate xsi:nil="true"/> <sQLDescription xsi:nil="true"/> diff --git a/src-db/database/sourcedata/AD_COLUMN.xml b/src-db/database/sourcedata/AD_COLUMN.xml --- a/src-db/database/sourcedata/AD_COLUMN.xml +++ b/src-db/database/sourcedata/AD_COLUMN.xml @@ -34632,7 +34632,7 @@ <!--2465--> <ISKEY><![CDATA[N]]></ISKEY> <!--2465--> <ISPARENT><![CDATA[N]]></ISPARENT> <!--2465--> <ISMANDATORY><![CDATA[Y]]></ISMANDATORY> -<!--2465--> <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE> +<!--2465--> <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE> <!--2465--> <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER> <!--2465--> <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED> <!--2465--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> diff --git a/src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DifferentOrgInAccSchema.class b/src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DifferentOrgInAccSchema.class new file mode 100644 index 0000000000000000000000000000000000000000..4a66636aeae065cc27c742ff96d19774a4a4283c GIT binary patch literal 10185 zc$~#q3w&EwdH)~1?vZr;h!Uk$lfvx-Y$uNGm_%umG*q_bV36(9cH*RI>t0LO_HATI zy^`#>48}%*@)|7d9&{^g0hR)#Eo+*(WSH01@#=W2&_D}p<+%rpF~(TRl6~ju>S?*D z>hPn#_}ue-_dEado$vg=?_8aJ;oQfU0CcmB9vr|2JlKy9O86@e?Dzo32@meWha`NM zW88y};C`Y1s4#j!ym^r02Jw7|<FI&sjN?Y}{A-Sz#PeZ}n<bnS_K$F!;&{|e+C_o% z7{|vsPILT?gim<zQZd_-cz%-OQyib>_zcHqh2n2H{*L2uj=$&l9LMK5zQFNCjxTXM z!SN3qU*`A<$5%PN#_^9FPjY;n;~N}Lah&1!Cdaopp5}Ol<J%nH;rK4cKXLps$Fm&Y z<M=+u4>*1(Jo}Mw`p2U8FQWIaqWL$`{JYToMD%_tn*R{u&qVJ(CH!2%e=$grXk;)l zG{)eI-m1>2oe4EL-8q^y^yKs|hKAl$GLu!4*#l}Kr!hFk!adOl4eJ~39Xqs7^!AMm z_eMrX8Eku_;zguCygy2KUJH4GhA_Czf%(4I8f-}xKwfg~jTVgZKzXS-9E**{X0%y# zVtinzZ+M(6ck4+#yNAKv+IE1!(VL2sgH2IAsSV|3CpBYColIzAU8$IwIG`H3kS(Pn zJELb9c0^OgbZ089B_|DaF4Z}i(-ZMIHKE7Vte#4C_UThonxQ4L!^ZSLvgiW^M$(RI zv0PT*x3=XYm&@vj&ZwTr((7hD8A}<47RyEw+AIMu?0Ru?^{H7gpF=f_s~L75UL8t8 zOA-njpxx4`(^z!Vii=!S^rd3u%h+e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^W^+-X&eyymT>c^hfohIQwO6i$kpgm*}Ir-VO{@GjsSy!2%3SJ?P#TuI%FsW^{~ zuotHUdL+Etg+DZ_+%fvQ3wK+U>@cmanbiHhOG6I&bJCy77YIr8<n1SMS;+0<ln5K% zgWbN3WO6x~yd>m0jh9l*Q+!vP!j%ChHNLAvbG2w*CYqO1a|$gXeu54A8VU%lgwRF^ zn@R|qD-qg7vqdx=C4>fFQywAg>m-COLfBeD=&nR~g=n^kX1i#DMHoEpTT^gk2f<uJ zFgr^yp-PxtqS-B)YfA`s_|_H>_7K7=3E{dDLbwv4M>M^n=_?`h`22Z<oxTVm^b^9~ z62hx$EM=f#6|^s&%>f5(&8rvjntPya7G3&_1{?ubfG=Wjy!d`d*h=~SaL60*hU9>} z6l|~u8~u&`hU2(8Ap0A;Lro<RPoU`}_ATQ2@jDu+5<YzbO_gw-fO`=m_h7v_Cg2Qs z=s7BsW8>l+wVO5aaXPR;ndYDz<CI-8<yA9f)H=$g%P4oQq8w?VyxB~7(@9x!Bi>EN z^)VWI7uCzVDXae&@5P_v1n$L0sP`b=hllZ(RCDg5TKOUT93RFn>CIVul(pbt)`gR7 z8y;cT;1t`9MW$nk8Tce+`={9L_%wSxKFjXI6YPF`g*}F^vM=FDs*~TKj6TE8;hQ!e z&e$%+Gqw%*wyg!v+Pd*QTLeEczXOg_B{@f){}I)kCiY`=nKegdKOyf$&1qmiL#tVH z8VPS3d2YZfa>}X}qL;50qW33+Vl#VxYSt!)t%oY^L5dW&?ZG|Nb3(R-@MqMc+_VKL z3J0mOt|OoBr5=5V+1e>02dOsQPxkMlp2w^;?}GO{1=3SU{J$`3P4z$EIfS1>zuAWO qoTo3Prsp4#FIi?`0nXF5c`s;B>+@bt+eH<Imc5?-j+@2j{r?ZVsK){T diff --git a/src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DifferentOrgInAccSchemaData.class b/src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DifferentOrgInAccSchemaData.class new file mode 100644 index 0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xTO;X$}#Y!n|kz!SteN3a1xzJ)7tr)ap zS+20dlA##1V<hvUlf$Bu+P1)9(Y67}L#3t@gVkZxiNTtf7_5nj!5Tvh)@Wj|CMJgX zjgHrgB8kD)VX&<*#gQV3!FD(!S#ASXgD*D%_r=gQg9qgEb1lt9@O}wTRX=KMhE`;3 z0~XO)n4!1818;)|{)@(mcWI({kBY^g=tA*lnk_yculNfs5r3r{#YePS9HaH(U)WLq zlkOFt(?jA5Yzsc7t>SOkMgN^X7oX4<;=i$r{*;TvKX5ud##6<=c$)YpPNtu89rT%q z2#Mq6*fHL#BhX4)b$nXs3mu<UoIADB6!jMY!uXtRYyoD2{WN^eHnsq>=`(c;ki;`| ze2&9uLN5HtG?DwOsI*WqJ5*FED)KIo3;#y4c3#9!yy~YUdLiMG{|`E*qv8k1Q(&(% zeL$r?=kovirQa&WZBpE>&3vT^2mPd>xmx6_*DqL7r{(EuWbeGrmoO9a^mQ-ExPmdu zfK#tv%rW7eYXqV>adewwqT3uD-R79+?yAl4dQoI>CwG`@)4wn}k`JFHV|zBXW*)@u zInV-#ZTWm!OT){=R!-wyNC%)<jM(<e|6*#w#>$jTgG_cBV(Lccm{O_0lulzzJ*mjl zi|S07G}|<g8cl=AV{%fnX%P8LLnvVCO$$wZ=nj*Eo;LNRXHEU+JyU<Sm<F)bG?3Fw zgSnT<$(g1>+z<Ky)7ffFUxGPq)}z);3-wzUGh$A=bun|M@i`51ugA2B&r)NRX$($% zaxD=w1UQg4EGCTdpK8=5sj=#l_bN4H4u_t4%^@#TXu8h(dXaiX689#>5?LXN++$mf oh+PF%g#WYdVA56wTTjZ`N2_;Iru@IU9P#_fsgR$md)R;d57wqJ4*&oF diff --git a/src-util/buildvalidation/src/org/openbravo/buildvalidation/DifferentOrgInAccSchema.java b/src-util/buildvalidation/src/org/openbravo/buildvalidation/DifferentOrgInAccSchema.java new file mode 100644 --- /dev/null +++ b/src-util/buildvalidation/src/org/openbravo/buildvalidation/DifferentOrgInAccSchema.java @@ -0,0 +1,233 @@ +/* + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.1 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * 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 Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo SLU + * All portions are Copyright (C) 2012 Openbravo SLU + * All Rights Reserved. + * Contributor(s): ______________________________________. + ************************************************************************ + */ +package org.openbravo.buildvalidation; + +import java.util.ArrayList; +import java.util.List; + +import org.openbravo.database.ConnectionProvider; + +/** + * This validation is related to this issue: https://issues.openbravo.com/view.php?id=20142 + * + * Same Org has to exist in parent tab and child tab + * + */ +public class DifferentOrgInAccSchema extends BuildValidation { + private static final String ELEMENT = "ELEMENT"; + private static final String TABLE = "TABLE"; + private static final String DOCTYPE = "DOCTYPE"; + private static final String PROCESS = "PROCESS"; + private static final String GL = "GL"; + private static final String DEFAULT = "DEFAULT"; + + + private static final String ELEMENT_TAB = "217"; + private static final String TABLE_TAB = "800041"; + private static final String DOCTYPE_TAB = "1007400000"; + private static final String PROCESS_TAB = "4F9E1C27F7F040C58C5CA2E6FD5B26CB"; + private static final String GL_TAB = "200"; + private static final String DEFAULT_TAB = "252"; + + + private static final String AccSchema_WINDOW = "125"; + + @Override + public List<String> execute() { + ConnectionProvider cp = getConnectionProvider(); + ArrayList<String> errors = new ArrayList<String>(); + try { + // Prevent error when upgrading from a pure 2.50 + //if (DuplicateDocExchangeRateData.existAPRMbasetables(cp)) { + + String errorMessage = "It is not allowed to have different organization for accounting schema and its child tabs . " + + "To fix this problem in your instance, please CONTACT YOUR SYSTEM ADMINISTRATOR. You can know the entries that are incorrect and by reviewing Alerts in your system. " + + "Once you find the incorrect entries you should correct them. After fixing all these entries you should be able to apply this MP."; + + // ELEMENT + DifferentOrgInAccSchemaData[] listOfIncorrectElement = DifferentOrgInAccSchemaData.selectDifOrgInElement(cp); + if (listOfIncorrectElement != null && listOfIncorrectElement.length > 0) { + errors.add(String.format(errorMessage, "ELEMENT")); + } + for (DifferentOrgInAccSchemaData incorrectElement : listOfIncorrectElement) { + processAlert(cp, incorrectElement, ELEMENT); + } + + // TABLE + DifferentOrgInAccSchemaData[] listOfIncorrectTable = DifferentOrgInAccSchemaData.selectDifOrgInTable(cp); + if (listOfIncorrectTable != null && listOfIncorrectTable.length > 0) { + errors.add(String.format(errorMessage, "TABLE")); + } + for (DifferentOrgInAccSchemaData incorrectTable : listOfIncorrectTable) { + processAlert(cp, incorrectTable, TABLE); + } + + // DocType + DifferentOrgInAccSchemaData[] listOfIncorrectDoc = DifferentOrgInAccSchemaData.selectDifOrgInDoc(cp); + if (listOfIncorrectDoc != null && listOfIncorrectDoc.length > 0) { + errors.add(String.format(errorMessage, "DOCTYPE")); + } + for (DifferentOrgInAccSchemaData incorrectDoc : listOfIncorrectDoc) { + processAlert(cp, incorrectDoc, DOCTYPE); + } + + // PROCESS + DifferentOrgInAccSchemaData[] listOfIncorrectProcess = DifferentOrgInAccSchemaData.selectDifOrgInProcess(cp); + if (listOfIncorrectProcess != null && listOfIncorrectProcess.length > 0) { + errors.add(String.format(errorMessage, "PROCESS")); + } + for (DifferentOrgInAccSchemaData incorrectProcess : listOfIncorrectProcess) { + processAlert(cp, incorrectProcess, PROCESS); + } + + // GL + DifferentOrgInAccSchemaData[] listOfIncorrectGL = DifferentOrgInAccSchemaData.selectDifOrgInGL(cp); + if (listOfIncorrectGL != null && listOfIncorrectGL.length > 0) { + errors.add(String.format(errorMessage, "GL")); + } + for (DifferentOrgInAccSchemaData incorrectGL : listOfIncorrectGL) { + processAlert(cp, incorrectGL, GL); + } + + // Default + DifferentOrgInAccSchemaData[] listOfIncorrectDefault = DifferentOrgInAccSchemaData.selectDifOrgInDefault(cp); + if (listOfIncorrectDefault != null && listOfIncorrectDefault.length > 0) { + errors.add(String.format(errorMessage, "DEFAULT")); + } + for (DifferentOrgInAccSchemaData incorrectDefault : listOfIncorrectDefault) { + processAlert(cp, incorrectDefault, DEFAULT); + } + + // } + } catch (Exception e) { + return handleError(e); + } + return errors; + } + + private void processAlert(ConnectionProvider cp, DifferentOrgInAccSchemaData incorrectOrg, String type) throws Exception { + String ALERT_RULE_NAME = ""; + String alertDescription = ""; + String strTabId = ""; + String strWindowId = AccSchema_WINDOW; + String ALERT_RULE_SQL = ""; + String strRecordId = incorrectOrg.referencekeyId; + + if (ELEMENT.equals(type)) { + //String invoice = "Y".equals(exchangeRate.issotrx) ? "Sales Invoice" : "Purchase Invoice"; + ALERT_RULE_NAME = "Different Org for Acct Schema and Acct Schema Element"; + alertDescription = "Different organization for Accounting Schema and Account Schema Element. Please ensure the same organization exists"; + strTabId = ELEMENT_TAB; + + ALERT_RULE_SQL = " select e.C_AcctSchema_Element_id as referencekey_id, ad_column_identifier('C_AcctSchema_Element', e.C_AcctSchema_Element_id,'en_US') as record_id, " + + " 0 as ad_role_id, null as ad_user_id, '" + alertDescription + "' as description, " + + " 'Y' as isActive, e.ad_client_id, e.ad_org_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy " + + " from C_AcctSchema c inner join C_AcctSchema_Element e ON c.c_acctSchema_id = e.c_acctSchema_id " + + " where c.ad_org_id <> e.ad_org_id"; + + } else if (TABLE.equals(type)) { + //String payment = "Y".equals(exchangeRate.isreceipt) ? "Payment IN" : "Payment OUT"; + ALERT_RULE_NAME = "Different Org for Acct Schema and Acct Schema Tables"; + alertDescription = "Different organization for Accounting Schema and Account Schema Tables. Please ensure the same organization exists"; + strTabId = TABLE_TAB; + + ALERT_RULE_SQL = " select t.C_AcctSchema_Table_id as referencekey_id, ad_column_identifier('C_AcctSchema_Table', t.C_AcctSchema_Table_id,'en_US') as record_id, " + + " 0 as ad_role_id, null as ad_user_id, '" + alertDescription + "' as description, " + + " 'Y' as isActive, t.ad_client_id, t.ad_org_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy " + + " from C_AcctSchema c inner join C_AcctSchema_Table t on c.c_acctSchema_id = t.c_acctSchema_id " + + " WHERE c.ad_org_id <> t.ad_org_id"; + + } else if (DOCTYPE.equals(type)) { + ALERT_RULE_NAME = "Different Org for Acct Schema and Documents"; + alertDescription = "Different organization for Accounting Schema and Documents. Please ensure the same organization exists"; + strTabId = DOCTYPE_TAB; + + ALERT_RULE_SQL = " select d.C_AcctSchema_Table_DocType_id as referencekey_id, ad_column_identifier('C_AcctSchema_Table_DocType', d.C_AcctSchema_Table_DocType_id,'en_US') as record_id, " + + " 0 as ad_role_id, null as ad_user_id, '" + alertDescription + "' as description, " + + " 'Y' as isActive, d.ad_client_id, d.ad_org_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy " + + " from (C_AcctSchema c inner join C_AcctSchema_Table t on c.c_acctSchema_id =t.c_acctSchema_id) " + + " inner join C_AcctSchema_Table_DocType d on t.C_AcctSchema_Table_id = d.C_AcctSchema_Table_id " + + " where c.ad_org_id <> d.ad_org_id"; + + } else if (PROCESS.equals(type)) { + ALERT_RULE_NAME = "Different Org for Acct Schema and Process"; + alertDescription = "Different organization for Accounting Schema and Process. Please ensure the same organization exists"; + strTabId = PROCESS_TAB; + + ALERT_RULE_SQL = " select p.C_AcctSchema_Process_id as referencekey_id, ad_column_identifier('C_AcctSchema_Process', p.C_AcctSchema_Process_id,'en_US') as record_id, " + + " 0 as ad_role_id, null as ad_user_id, '" + alertDescription + "' as description, " + + " 'Y' as isActive, p.ad_client_id, p.ad_org_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy " + + " from C_AcctSchema c inner join C_AcctSchema_Process p on c.c_acctSchema_id = p.c_acctSchema_id " + + " where c.ad_org_id <> p.ad_org_id"; + + } else if (GL.equals(type)) { + ALERT_RULE_NAME = "Different Org for Acct Schema and General Ledger"; + alertDescription = "Different organization for Accounting Schema and General Ledger. Please ensure the same organization exists"; + strTabId = GL_TAB; + + ALERT_RULE_SQL = " select gl.C_AcctSchema_GL_id as referencekey_id, ad_column_identifier('C_AcctSchema_GL', gl.C_AcctSchema_GL_id,'en_US') as record_id, " + + " 0 as ad_role_id, null as ad_user_id, '" + alertDescription + "' as description, " + + " 'Y' as isActive, gl.ad_client_id, gl.ad_org_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy " + + " from C_AcctSchema c inner join C_AcctSchema_GL gl on c.c_acctSchema_id = gl.c_acctSchema_id " + + " where c.ad_org_id <> gl.ad_org_id"; + + } else if (DEFAULT.equals(type)) { + ALERT_RULE_NAME = "Different Org for Acct Schema and Defaults"; + alertDescription = "Different organization for Accounting Schema and Defaults. Please ensure the same organization exists"; + strTabId = DEFAULT_TAB; + + ALERT_RULE_SQL = " select d.C_AcctSchema_Default_id as referencekey_id, ad_column_identifier('C_AcctSchema_Default', d.C_AcctSchema_Default_id,'en_US') as record_id, " + + " 0 as ad_role_id, null as ad_user_id, '" + alertDescription + "' as description, " + + " 'Y' as isActive, d.ad_client_id, d.ad_org_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy " + + " from C_AcctSchema c inner join C_AcctSchema_Default d on c.c_acctSchema_id = d.c_acctSchema_id " + + " where c.ad_org_id <> d.ad_org_id"; + + } else { + //invalid type + } + + String alertRuleId = ""; + + // Check if exists the alert rule + if (!DifferentOrgInAccSchemaData.existsAlertRule(cp, ALERT_RULE_NAME, incorrectOrg.adClientId)) { + DifferentOrgInAccSchemaData.insertAlertRule(cp, incorrectOrg.adClientId, incorrectOrg.adOrgId, + ALERT_RULE_NAME, strTabId, ALERT_RULE_SQL); + + alertRuleId = DifferentOrgInAccSchemaData.getAlertRuleId(cp, ALERT_RULE_NAME, + incorrectOrg.adClientId); + DifferentOrgInAccSchemaData[] roles = DifferentOrgInAccSchemaData.getRoleId(cp, + strWindowId, incorrectOrg.adClientId); + for (DifferentOrgInAccSchemaData role : roles) { + DifferentOrgInAccSchemaData.insertAlertRecipient(cp, incorrectOrg.adClientId, + incorrectOrg.adOrgId, alertRuleId, role.adRoleId); + } + } else { + alertRuleId = DifferentOrgInAccSchemaData.getAlertRuleId(cp, ALERT_RULE_NAME, + incorrectOrg.adClientId); + } + + // Check if exist the concrete alert + if (!DifferentOrgInAccSchemaData.existsAlert(cp, alertRuleId, strRecordId)) { + DifferentOrgInAccSchemaData.insertAlert(cp, incorrectOrg.adClientId, alertDescription, + alertRuleId, incorrectOrg.recordinfo, strRecordId); + } + + } + +} \ No newline at end of file diff --git a/src-util/buildvalidation/src/org/openbravo/buildvalidation/DifferentOrgInAccSchema_data.xsql b/src-util/buildvalidation/src/org/openbravo/buildvalidation/DifferentOrgInAccSchema_data.xsql new file mode 100644 --- /dev/null +++ b/src-util/buildvalidation/src/org/openbravo/buildvalidation/DifferentOrgInAccSchema_data.xsql @@ -0,0 +1,205 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.1 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * 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 Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo SLU + * All portions are Copyright (C) 2012 Openbravo SLU + * All Rights Reserved. + * Contributor(s): ______________________________________. + ************************************************************************ +--> + + +<SqlClass name="DifferentOrgInAccSchemaData" package="org.openbravo.buildvalidation"> + <SqlMethod name="dummy" type="preparedStatement" return="multiple"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + SELECT '' AS documentno, '' AS referencekey_id, '' AS ad_client_id, + '' AS ad_org_id, '' AS recordinfo, '' AS ad_role_id + FROM DUAL + ]]></Sql> + </SqlMethod> + <SqlMethod name="selectDifOrgInElement" type="preparedStatement" return="multiple"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + select e.C_AcctSchema_Element_id as referencekey_id, e.ad_client_id, e.ad_org_id, + ad_column_identifier('C_AcctSchema_Element', e.C_AcctSchema_Element_id,'en_US') as recordinfo + from C_AcctSchema c inner join C_AcctSchema_Element e ON c.c_acctSchema_id = e.c_acctSchema_id + where c.ad_org_id <> e.ad_org_id + ]]></Sql> + </SqlMethod> + <SqlMethod name="selectDifOrgInTable" type="preparedStatement" return="multiple"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + select t.C_AcctSchema_Table_id as referencekey_id, t.ad_client_id, t.ad_org_id, + ad_column_identifier('C_AcctSchema_Table', t.C_AcctSchema_Table_id,'en_US') as recordinfo + from C_AcctSchema c inner join C_AcctSchema_Table t on c.c_acctSchema_id = t.c_acctSchema_id + WHERE c.ad_org_id <> t.ad_org_id + ]]></Sql> + </SqlMethod> + <SqlMethod name="selectDifOrgInDoc" type="preparedStatement" return="multiple"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + select d.C_AcctSchema_Table_DocType_id as referencekey_id, d.ad_client_id, d.ad_org_id, + ad_column_identifier('C_AcctSchema_Table_DocType', d.C_AcctSchema_Table_DocType_id,'en_US') as recordinfo + from (C_AcctSchema c inner join C_AcctSchema_Table t on c.c_acctSchema_id =t.c_acctSchema_id) + inner join C_AcctSchema_Table_DocType d on t.C_AcctSchema_Table_id = d.C_AcctSchema_Table_id + where c.ad_org_id <> d.ad_org_id + ]]></Sql> + </SqlMethod> + <SqlMethod name="selectDifOrgInProcess" type="preparedStatement" return="multiple"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + select p.C_AcctSchema_Process_id as referencekey_id, p.ad_client_id, p.ad_org_id, + ad_column_identifier('C_AcctSchema_Process', p.C_AcctSchema_Process_id,'en_US') as recordinfo + from C_AcctSchema c inner join C_AcctSchema_Process p on c.c_acctSchema_id = p.c_acctSchema_id + where c.ad_org_id <> p.ad_org_id + ]]></Sql> + </SqlMethod> + <SqlMethod name="selectDifOrgInGL" type="preparedStatement" return="multiple"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + select gl.C_AcctSchema_GL_id as referencekey_id, gl.ad_client_id, gl.ad_org_id, + ad_column_identifier('C_AcctSchema_GL', gl.C_AcctSchema_GL_id,'en_US') as recordinfo + from C_AcctSchema c inner join C_AcctSchema_GL gl on c.c_acctSchema_id = gl.c_acctSchema_id + where c.ad_org_id <> gl.ad_org_id + ]]></Sql> + </SqlMethod> + <SqlMethod name="selectDifOrgInDefault" type="preparedStatement" return="multiple"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + select d.C_AcctSchema_Default_id as referencekey_id, d.ad_client_id, d.ad_org_id, + ad_column_identifier('C_AcctSchema_Default', d.C_AcctSchema_Default_id,'en_US') as recordinfo + from C_AcctSchema c inner join C_AcctSchema_Default d on c.c_acctSchema_id = d.c_acctSchema_id + where c.ad_org_id <> d.ad_org_id + ]]></Sql> + </SqlMethod> + <SqlMethod name="getAlertRuleId" type="preparedStatement" return="string"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + SELECT MAX(ad_alertrule_id) AS name + FROM AD_ALERTRULE + WHERE NAME = ? + AND ISACTIVE = 'Y' + AND AD_CLIENT_ID = ? + ]]></Sql> + <Parameter name="name"/> + <Parameter name="client"/> + </SqlMethod> + <SqlMethod name="existsAlert" type="preparedStatement" return="boolean"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + SELECT COUNT(*) AS EXISTING + FROM AD_ALERT + WHERE AD_ALERTRULE_ID = ? + AND REFERENCEKEY_ID = ? + AND ISFIXED = 'N' + ]]> + </Sql> + <Parameter name="alertRule"/> + <Parameter name="payment"/> + </SqlMethod> + <SqlMethod name="existsAlertRule" type="preparedStatement" return="boolean"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + SELECT COUNT(*) AS EXISTING + FROM AD_ALERTRULE + WHERE NAME = ? + AND ISACTIVE = 'Y' + AND AD_CLIENT_ID = ? + ]]> + </Sql> + <Parameter name="alertRule"/> + <Parameter name="client"/> + </SqlMethod> + <SqlMethod name="insertAlertRule" type="preparedStatement" return="rowcount"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + INSERT INTO AD_ALERTRULE ( + AD_ALERTRULE_ID, AD_CLIENT_ID, AD_ORG_ID,ISACTIVE, + CREATED, CREATEDBY, UPDATED, UPDATEDBY, + NAME, AD_TAB_ID, FILTERCLAUSE, TYPE, + SQL + ) VALUES ( + get_uuid(), ?, ?, 'Y', + now(), '100', now(), '100', + ?, ?, '', 'D', + ? + ) + ]]></Sql> + <Parameter name="clientId"/> + <Parameter name="orgId"/> + <Parameter name="name"/> + <Parameter name="tabId"/> + <Parameter name="sql"/> + </SqlMethod> + <SqlMethod name="insertAlert" type="preparedStatement" return="rowcount"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + INSERT INTO AD_Alert ( + AD_Alert_ID, AD_Client_ID, AD_Org_ID, IsActive, + Created, CreatedBy, Updated, UpdatedBy, + Description, AD_AlertRule_ID, Record_Id, Referencekey_ID + ) VALUES ( + get_uuid(), ?, '0', 'Y', + NOW(), '0', NOW(), '0', + ?, ?, ?, ?) + ]]> + </Sql> + <Parameter name="client"/> + <Parameter name="description" /> + <Parameter name="adAlertRuleId" /> + <Parameter name="recordId" /> + <Parameter name="referencekey_id" /> + </SqlMethod> + <SqlMethod name="getRoleId" type="preparedStatement" return="multiple"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + SELECT distinct r.ad_role_id + FROM ad_window_access wa join ad_role r on (wa.ad_role_id=r.ad_role_id) + WHERE wa.ad_window_id = ? + AND wa.ad_client_id = ? + AND wa.isactive = 'Y' + AND r.isactive = 'Y' + AND r.ismanual = 'Y' + ]]></Sql> + <Parameter name="window"/> + <Parameter name="clientId"/> + </SqlMethod> + <SqlMethod name="insertAlertRecipient" type="preparedStatement" return="rowcount"> + <SqlMethodComment></SqlMethodComment> + <Sql><![CDATA[ + INSERT INTO ad_alertrecipient( + ad_user_id, ad_client_id, ad_org_id, isactive, created, createdby, + updated, updatedby, ad_alertrecipient_id, ad_alertrule_id, ad_role_id, + sendemail) + VALUES (null, ?, ?, 'Y', now(), '100', + now(), '100', get_uuid(), ?, ?, + 'N') + ]]> + </Sql> + <Parameter name="client"/> + <Parameter name="org"/> + <Parameter name="adAlertRuleId" /> + <Parameter name="role" /> + </SqlMethod> + <SqlMethod name="existAPRMbasetables" type="preparedStatement" return="boolean"> + <SqlMethodComment>Check if the FIN_Finacc_Transaction table exist</SqlMethodComment> + <Sql><![CDATA[ + SELECT count(*) AS EXISTING + FROM ad_table + WHERE ad_table_id = '4D8C3B3C31D1410DA046140C9F024D17' + ]]> + </Sql> + </SqlMethod> +</SqlClass> + | |||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | ||||||||
|
Notes | |
(0048891) naiaramartinez (developer) 2012-05-23 17:47 |
Go to Accounting Schema window. Select one record. Go to all its child's tab. Create new record. Notice that you can't see/modify organization field. By default selected organization is parent organization, so child always have parent's organization. Test Plan (build validation) Before applying the fix you need to have incorrect records in 'Account Schema Element', 'Account Schema Tables', 'Process', 'General Ledger' and 'Defaults' tabs. Those tabs are child tabs of Accounting Schema. So, go to database and insert an incorrect record in C_AcctSchema_Table, C_AcctSchema_Table_DocType, C_AcctSchema_Process, C_AcctSchema_GL and C_AcctSchema_Default. You need to insert a diferent organization than its c_AcctSchema's organization. Apply the fix. Run ant smartbuild -Dlocal=no. The compilation should fail (the record that you inserted and two records that were incorrect for QA client). Go to application as client admin role. Browse to the wrong records. You need to correct those incorrect record in the database (because in the application you can't modify the organization). After correcting them, run ant smartbuild -Dlocal=no again. The complication should go fine. |
(0077403) naiaramartinez (developer) 2015-05-13 17:07 |
I attach a solution made in 2012, but I don't know if it still will work or not. The main problem here, is that Openbravo allows you to have headers with one organization and children with different organization. For example: * Go to 'General Ledger Configuration' (this window is the same as Account schema. The window was renamed) * create a record with 'Region norte' organization * Go to 'dimension' tab and create one record * Go to header again, and modify organization to 'Region Sur'. * Do a select in the bbdd, and notice that the organzation of the record created in dimesion tab, is still 'Region Norte' |
Issue History | |||
Date Modified | Username | Field | Change |
2012-04-17 20:45 | vmromanos | New Issue | |
2012-04-17 20:45 | vmromanos | Assigned To | => vmromanos |
2012-04-17 20:45 | vmromanos | Modules | => Core |
2012-04-17 20:45 | vmromanos | Relationship added | related to 0020254 |
2012-04-19 18:43 | mirurita | Tag Attached: MIR-Reviewed | |
2012-05-10 12:12 | gorka_gil | Assigned To | vmromanos => mirurita |
2012-05-22 17:25 | naiaramartinez | Assigned To | mirurita => naiaramartinez |
2012-05-22 17:26 | naiaramartinez | Status | new => scheduled |
2012-05-22 17:26 | naiaramartinez | fix_in_branch | => pi |
2012-05-23 17:47 | naiaramartinez | Note Added: 0048891 | |
2015-05-13 16:58 | naiaramartinez | Assigned To | naiaramartinez => Triage Finance |
2015-05-13 17:07 | naiaramartinez | Note Added: 0077403 | |
2015-05-13 17:08 | naiaramartinez | File Added: bug_20294.diff |
Copyright © 2000 - 2009 MantisBT Group |