IDEMPIERE-1025 Improve translation for custom tables / failing on new as recordid was being set before savinb
This commit is contained in:
parent
b67f23135c
commit
fad6179c03
|
@ -78,7 +78,6 @@ public class AdElementHandler extends AbstractElementHandler {
|
|||
element.unresolved = notfounds.toString();
|
||||
return;
|
||||
}
|
||||
element.recordId = mElement.getAD_Element_ID();
|
||||
if (mElement.is_new() || mElement.is_Changed()) {
|
||||
X_AD_Package_Imp_Detail impDetail = createImportDetail(ctx, element.qName, X_AD_Element.Table_Name, X_AD_Element.Table_ID);
|
||||
if (!mElement.is_new()) {
|
||||
|
@ -100,6 +99,7 @@ public class AdElementHandler extends AbstractElementHandler {
|
|||
throw new POSaveFailedException("Failed to save Element " + mElement.getName());
|
||||
}
|
||||
}
|
||||
element.recordId = mElement.getAD_Element_ID();
|
||||
} else {
|
||||
element.skip = true;
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@ public class FieldElementHandler extends AbstractElementHandler {
|
|||
if (mField.save(getTrxName(ctx)) == true) {
|
||||
logImportDetail(ctx, impDetail, 1, mField.getName(), mField
|
||||
.get_ID(), action);
|
||||
element.recordId = mField.getAD_Field_ID();
|
||||
} else {
|
||||
logImportDetail(ctx, impDetail, 0, mField.getName(), mField
|
||||
.get_ID(), action);
|
||||
|
|
|
@ -99,6 +99,7 @@ public class FieldGroupElementHandler extends AbstractElementHandler {
|
|||
logImportDetail(ctx, impDetail, 1, fieldGroup.getName(),
|
||||
fieldGroup.get_ID(), action);
|
||||
processedFieldGroups.add(fieldGroup.getAD_FieldGroup_ID());
|
||||
element.recordId = fieldGroup.getAD_FieldGroup_ID();
|
||||
|
||||
} else {
|
||||
logImportDetail(ctx, impDetail, 0, fieldGroup.getName(),
|
||||
|
|
|
@ -82,6 +82,7 @@ public class FormElementHandler extends AbstractElementHandler {
|
|||
|
||||
if (mForm.save(getTrxName(ctx)) == true){
|
||||
logImportDetail (ctx, impDetail, 1, mForm.getName(), mForm.get_ID(), action);
|
||||
element.recordId = mForm.get_ID();
|
||||
}
|
||||
else{
|
||||
logImportDetail (ctx, impDetail, 0, mForm.getName(), mForm.get_ID(), action);
|
||||
|
|
|
@ -96,6 +96,7 @@ public class MenuElementHandler extends AbstractElementHandler {
|
|||
try {
|
||||
logImportDetail(ctx, impDetail, 1, mMenu.getName(), mMenu
|
||||
.get_ID(), action);
|
||||
element.recordId = mMenu.get_ID();
|
||||
} catch (SAXException e) {
|
||||
if (log.isLoggable(Level.INFO)) log.info("setmenu:" + e);
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ public class MessageElementHandler extends AbstractElementHandler {
|
|||
if (mMessage.save(getTrxName(ctx)) == true){
|
||||
logImportDetail (ctx, impDetail, 1, mMessage.getValue(), mMessage.get_ID(),action);
|
||||
messages.add(mMessage.getAD_Message_ID());
|
||||
element.recordId = mMessage.getAD_Message_ID();
|
||||
}
|
||||
else{
|
||||
logImportDetail (ctx, impDetail, 0, mMessage.getValue(), mMessage.get_ID(),action);
|
||||
|
|
|
@ -128,6 +128,7 @@ public class PrintFormatItemElementHandler extends AbstractElementHandler {
|
|||
if (mPrintFormatItem.save(getTrxName(ctx)) == true) {
|
||||
logImportDetail(ctx, impDetail, 1, mPrintFormatItem.getName(),
|
||||
mPrintFormatItem.get_ID(), action);
|
||||
element.recordId = mPrintFormatItem.get_ID();
|
||||
} else {
|
||||
logImportDetail(ctx, impDetail, 0, mPrintFormatItem.getName(),
|
||||
mPrintFormatItem.get_ID(), action);
|
||||
|
|
|
@ -95,6 +95,7 @@ public class ProcessElementHandler extends AbstractElementHandler {
|
|||
if (mProcess.save(getTrxName(ctx)) == true) {
|
||||
logImportDetail(ctx, impDetail, 1, mProcess.getName(), mProcess
|
||||
.get_ID(), action);
|
||||
element.recordId = mProcess.get_ID();
|
||||
} else {
|
||||
logImportDetail(ctx, impDetail, 0, mProcess.getName(), mProcess
|
||||
.get_ID(), action);
|
||||
|
|
|
@ -105,6 +105,7 @@ public class ProcessParaElementHandler extends AbstractElementHandler {
|
|||
if (mProcessPara.save(getTrxName(ctx)) == true) {
|
||||
logImportDetail(ctx, impDetail, 1, mProcessPara.getColumnName(),
|
||||
mProcessPara.get_ID(), action);
|
||||
element.recordId = mProcessPara.get_ID();
|
||||
} else {
|
||||
logImportDetail(ctx, impDetail, 0, mProcessPara.getColumnName(),
|
||||
mProcessPara.get_ID(), action);
|
||||
|
|
|
@ -96,6 +96,7 @@ public class ReferenceElementHandler extends AbstractElementHandler {
|
|||
logImportDetail(ctx, impDetail, 1, mReference.getName(),
|
||||
mReference.get_ID(), action);
|
||||
references.add(mReference.getAD_Reference_ID());
|
||||
element.recordId = mReference.getAD_Reference_ID();
|
||||
} else {
|
||||
logImportDetail(ctx, impDetail, 0, mReference.getName(),
|
||||
mReference.get_ID(), action);
|
||||
|
|
|
@ -92,6 +92,7 @@ public class ReferenceListElementHandler extends AbstractElementHandler {
|
|||
if (mRefList.save(getTrxName(ctx)) == true) {
|
||||
logImportDetail(ctx, impDetail, 1, mRefList.getName(),
|
||||
mRefList.get_ID(), action);
|
||||
element.recordId = mRefList.get_ID();
|
||||
} else {
|
||||
logImportDetail(ctx, impDetail, 0, mRefList.getName(),
|
||||
mRefList.get_ID(), action);
|
||||
|
|
|
@ -51,7 +51,7 @@ public class SQLStatementElementHandler extends AbstractElementHandler {
|
|||
// NOTE Postgres needs to commit DDL statements
|
||||
// add a SQL command just with COMMIT if you want to simulate the Oracle behavior (commit on DDL)
|
||||
|
||||
// It is also recommended on postgres to add a COMMIT before any SQL statement that can fail
|
||||
// It is also necessary on postgres to add a COMMIT before any SQL statement that can fail
|
||||
// for example a create index where is possible the index already exists
|
||||
|
||||
pstmt = DB.prepareStatement(sql, getTrxName(ctx));
|
||||
|
|
|
@ -154,7 +154,7 @@ public class TabElementHandler extends AbstractElementHandler {
|
|||
}
|
||||
if (mTab.save(getTrxName(ctx)) == true){
|
||||
logImportDetail (ctx, impDetail, 1, mTab.getName(), mTab.get_ID(),action);
|
||||
element.recordId = mTab.getAD_Tab_ID();
|
||||
element.recordId = mTab.get_ID();
|
||||
} else {
|
||||
logImportDetail (ctx, impDetail, 0, mTab.getName(), mTab.get_ID(),action);
|
||||
throw new POSaveFailedException("Failed to save Tab " + mTab.getName());
|
||||
|
|
|
@ -81,6 +81,7 @@ public class TaskElementHandler extends AbstractElementHandler {
|
|||
if (mTask.save(getTrxName(ctx)) == true) {
|
||||
logImportDetail(ctx, impDetail, 1, mTask.getName(), mTask.get_ID(),
|
||||
action);
|
||||
element.recordId = mTask.get_ID();
|
||||
} else {
|
||||
logImportDetail(ctx, impDetail, 0, mTask.getName(), mTask.get_ID(),
|
||||
action);
|
||||
|
|
|
@ -105,6 +105,7 @@ public class WindowElementHandler extends AbstractElementHandler {
|
|||
logImportDetail(ctx, impDetail, 1, mWindow.getName(), mWindow
|
||||
.get_ID(), action);
|
||||
windows.add(mWindow.getAD_Window_ID());
|
||||
element.recordId = mWindow.get_ID();
|
||||
} else {
|
||||
logImportDetail(ctx, impDetail, 0, mWindow.getName(), mWindow
|
||||
.get_ID(), action);
|
||||
|
|
|
@ -103,6 +103,7 @@ public class WorkflowElementHandler extends AbstractElementHandler {
|
|||
logImportDetail(ctx,impDetail, 1, mWorkflow.getName(), mWorkflow
|
||||
.get_ID(), action);
|
||||
workflows.add(mWorkflow.getAD_Workflow_ID());
|
||||
element.recordId = mWorkflow.get_ID();
|
||||
} else {
|
||||
log.info("m_Workflow save failure");
|
||||
logImportDetail(ctx, impDetail, 0, mWorkflow.getName(), mWorkflow
|
||||
|
|
|
@ -112,6 +112,7 @@ public class WorkflowNodeElementHandler extends AbstractElementHandler {
|
|||
log.info("m_WFNode save success");
|
||||
logImportDetail(ctx, impDetail, 1, mWFNode.getName(), mWFNode
|
||||
.get_ID(), action);
|
||||
element.recordId = mWFNode.get_ID();
|
||||
} else {
|
||||
log.info("m_WFNode save failure");
|
||||
logImportDetail(ctx, impDetail, 0, mWFNode.getName(), mWFNode
|
||||
|
|
Loading…
Reference in New Issue