IDEMPIERE-4667 Project can not be printed using template print format (#550)

This commit is contained in:
hengsin 2021-01-25 00:13:47 +08:00 committed by GitHub
parent 2dbbc93485
commit 72d66b8868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -53,6 +53,7 @@ import org.compiere.model.MClientInfo;
import org.compiere.model.MQuery;
import org.compiere.model.MSysConfig;
import org.compiere.model.MTable;
import org.compiere.model.PO;
import org.compiere.model.PrintInfo;
import org.compiere.print.ArchiveEngine;
import org.compiere.print.CPaper;
@ -69,6 +70,7 @@ import org.compiere.print.util.SerializableMatrix;
import org.compiere.print.util.SerializableMatrixImpl;
import org.compiere.report.MReportLine;
import org.compiere.util.CLogger;
import org.compiere.util.CacheMgt;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
@ -1649,8 +1651,17 @@ public class LayoutEngine implements Pageable, Printable, Doc
additionalLines.put(Integer.valueOf(col), Integer.valueOf(item.getBelowColumn()-1));
if (!item.isSuppressNull())
{
if (item.is_Immutable())
item = new MPrintFormatItem(item);
item.setIsSuppressNull(true); // display size will be set to 0 in TableElement
item.saveEx();
try {
//this can be tenant or system print format
PO.setCrossTenantSafe();
item.saveEx();
} finally {
PO.clearCrossTenantSafe();
}
CacheMgt.get().reset(MPrintFormat.Table_Name, format.get_ID());
}
}
columnHeader[col] = new ValueNamePair(item.getColumnName(),