Commit 6932031f authored by meriem azaf's avatar meriem azaf Committed by Cristian Berner
Browse files

Fixes ISSUE-49011: Remove obsolete Translation Required field from Module window

The problem that creating a new module with the translation required flag unchecked and create also a new window for that module after running the validatio it complains about that module not being marked as translation required.

To fix this, we removed the field translation required from Module window and also the function checkUIArtifacts from ModuleValidator. we deprecated the column in AD.
parent 9e57dc55
......@@ -294760,7 +294760,7 @@ Price Lists are used to determine the pricing, margin and cost of items purchase
<!--58E097397CD45976E040007F010065CF--> <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
<!--58E097397CD45976E040007F010065CF--> <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
<!--58E097397CD45976E040007F010065CF--> <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
<!--58E097397CD45976E040007F010065CF--> <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
<!--58E097397CD45976E040007F010065CF--> <DEVELOPMENTSTATUS><![CDATA[DP]]></DEVELOPMENTSTATUS>
<!--58E097397CD45976E040007F010065CF--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--58E097397CD45976E040007F010065CF--> <POSITION><![CDATA[24]]></POSITION>
<!--58E097397CD45976E040007F010065CF--> <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
......@@ -306436,7 +306436,7 @@ Advanced features are only granted to the automatic roles defined as advanced.]]
<!--682633A6E69F9D31E040007F010061E4--> <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
<!--682633A6E69F9D31E040007F010061E4--> <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
<!--682633A6E69F9D31E040007F010061E4--> <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
<!--682633A6E69F9D31E040007F010061E4--> <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
<!--682633A6E69F9D31E040007F010061E4--> <DEVELOPMENTSTATUS><![CDATA[DP]]></DEVELOPMENTSTATUS>
<!--682633A6E69F9D31E040007F010061E4--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--682633A6E69F9D31E040007F010061E4--> <POSITION><![CDATA[25]]></POSITION>
<!--682633A6E69F9D31E040007F010061E4--> <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
......@@ -224728,34 +224728,6 @@ NOTE: You will not be able to close the fiscal year if you close all its periods
<!--58E0AFDC8162B4CCE040007F01006F95--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
<!--58E0AFDC8162B4CCE040007F01006F95--></AD_FIELD>
 
<!--58E0AFDC8164B4CCE040007F01006F95--><AD_FIELD>
<!--58E0AFDC8164B4CCE040007F01006F95--> <AD_FIELD_ID><![CDATA[58E0AFDC8164B4CCE040007F01006F95]]></AD_FIELD_ID>
<!--58E0AFDC8164B4CCE040007F01006F95--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
<!--58E0AFDC8164B4CCE040007F01006F95--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--58E0AFDC8164B4CCE040007F01006F95--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--58E0AFDC8164B4CCE040007F01006F95--> <NAME><![CDATA[Translation Required]]></NAME>
<!--58E0AFDC8164B4CCE040007F01006F95--> <DESCRIPTION><![CDATA[This module requires of tranlsation]]></DESCRIPTION>
<!--58E0AFDC8164B4CCE040007F01006F95--> <HELP><![CDATA[The current module contains user interface elements that can be translated to different languages.]]></HELP>
<!--58E0AFDC8164B4CCE040007F01006F95--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
<!--58E0AFDC8164B4CCE040007F01006F95--> <AD_TAB_ID><![CDATA[F53E35A11C564F20BE4082A7B8CFF6B7]]></AD_TAB_ID>
<!--58E0AFDC8164B4CCE040007F01006F95--> <AD_COLUMN_ID><![CDATA[58E097397CD45976E040007F010065CF]]></AD_COLUMN_ID>
<!--58E0AFDC8164B4CCE040007F01006F95--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
<!--58E0AFDC8164B4CCE040007F01006F95--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
<!--58E0AFDC8164B4CCE040007F01006F95--> <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
<!--58E0AFDC8164B4CCE040007F01006F95--> <ISREADONLY><![CDATA[N]]></ISREADONLY>
<!--58E0AFDC8164B4CCE040007F01006F95--> <SEQNO><![CDATA[90]]></SEQNO>
<!--58E0AFDC8164B4CCE040007F01006F95--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
<!--58E0AFDC8164B4CCE040007F01006F95--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
<!--58E0AFDC8164B4CCE040007F01006F95--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
<!--58E0AFDC8164B4CCE040007F01006F95--> <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
<!--58E0AFDC8164B4CCE040007F01006F95--> <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
<!--58E0AFDC8164B4CCE040007F01006F95--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--58E0AFDC8164B4CCE040007F01006F95--> <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
<!--58E0AFDC8164B4CCE040007F01006F95--> <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
<!--58E0AFDC8164B4CCE040007F01006F95--> <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
<!--58E0AFDC8164B4CCE040007F01006F95--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
<!--58E0AFDC8164B4CCE040007F01006F95--></AD_FIELD>
<!--58E839A092AA0D3BE040007F01015CDF--><AD_FIELD>
<!--58E839A092AA0D3BE040007F01015CDF--> <AD_FIELD_ID><![CDATA[58E839A092AA0D3BE040007F01015CDF]]></AD_FIELD_ID>
<!--58E839A092AA0D3BE040007F01015CDF--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
......@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
* All portions are Copyright (C) 2010-2011 Openbravo SLU
* All portions are Copyright (C) 2010-2022 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
......@@ -61,7 +61,6 @@ public class CreateCustomModule implements Process {
module.setDescription(MODULE_NAME + " is an autogenerated module to store new developments.");
module.setInDevelopment(true);
module.setVersion("1.0.0");
module.setTranslationRequired(true);
OBCriteria<Language> langCriteria = OBDal.getInstance().createCriteria(Language.class);
langCriteria.add(Restrictions.eq(Language.PROPERTY_LANGUAGE, "en_US"));
module.setLanguage(langCriteria.list().get(0));
......
......@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
* All portions are Copyright (C) 2009-2016 Openbravo SLU
* All portions are Copyright (C) 2009-2022 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
......@@ -28,7 +28,6 @@ import java.util.Map;
import org.hibernate.criterion.Restrictions;
import org.openbravo.base.model.NamingUtil;
import org.openbravo.base.session.OBPropertiesProvider;
import org.openbravo.base.structure.BaseOBObject;
import org.openbravo.dal.service.OBCriteria;
import org.openbravo.dal.service.OBDal;
import org.openbravo.erpCommon.modules.VersionUtility;
......@@ -36,14 +35,6 @@ import org.openbravo.erpCommon.modules.VersionUtility.VersionComparator;
import org.openbravo.model.ad.datamodel.Table;
import org.openbravo.model.ad.module.Module;
import org.openbravo.model.ad.module.ModuleDependency;
import org.openbravo.model.ad.ui.Element;
import org.openbravo.model.ad.ui.Field;
import org.openbravo.model.ad.ui.Form;
import org.openbravo.model.ad.ui.Menu;
import org.openbravo.model.ad.ui.Message;
import org.openbravo.model.ad.ui.Tab;
import org.openbravo.model.ad.ui.TextInterface;
import org.openbravo.model.ad.ui.Window;
import org.openbravo.model.ad.utility.DataSet;
import org.openbravo.service.system.SystemValidationResult.SystemValidationType;
......@@ -118,8 +109,6 @@ public class ModuleValidator implements SystemValidator {
checkJavaPackages(module, result);
checkHasUIArtifact(module, result);
checkTableName(module, result);
checkHasReferenceData(module, result);
......@@ -183,26 +172,6 @@ public class ModuleValidator implements SystemValidator {
}
}
private void checkHasUIArtifact(Module module, SystemValidationResult result) {
if (module.isTranslationRequired()) {
return;
}
final boolean reportError = hasArtifact(Window.class, module) || hasArtifact(Tab.class, module)
|| hasArtifact(Field.class, module) || hasArtifact(Element.class, module)
|| hasArtifact(TextInterface.class, module) || hasArtifact(Message.class, module)
|| hasArtifact(Form.class, module) || hasArtifact(Menu.class, module);
if (reportError) {
result.addError(SystemValidationType.MODULE_ERROR, "Module " + module.getName()
+ " has UI Artifacts, " + "translation required should be set to 'Y', it is now 'N'.");
}
}
private <T extends BaseOBObject> boolean hasArtifact(Class<T> clz, Module module) {
final OBCriteria<T> obc = OBDal.getInstance().createCriteria(clz);
obc.add(Restrictions.eq("module", module));
return obc.count() > 0;
}
/**
* Checks the defined dependency versions are present in DB
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment