From d3d7e57cf98f3e49cbb08fd195e0d06300517360 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Wed, 22 Apr 2020 19:57:42 +0200 Subject: [PATCH] IDEMPIERE-4245 Set GL Category automatically for GL Journal --- org.adempiere.base/src/org/compiere/model/MJournal.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/MJournal.java b/org.adempiere.base/src/org/compiere/model/MJournal.java index 5290670a88..8a29d901c6 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournal.java +++ b/org.adempiere.base/src/org/compiere/model/MJournal.java @@ -330,6 +330,9 @@ public class MJournal extends X_GL_Journal implements DocAction } } + if (getGL_Category_ID() == 0 && getC_DocType_ID() > 0) + setGL_Category_ID(MDocType.get(getCtx(), getC_DocType_ID()).getGL_Category_ID()); + // IDEMPIERE-63 // for documents that can be reactivated we cannot allow changing // C_DocTypeTarget_ID or C_DocType_ID if they were already processed and isOverwriteSeqOnComplete