IDEMPIERE-5058 Pack In from a tenant print format just packed out throws cross tenant error because of Print Paper (#1008)

This commit is contained in:
Carlos Ruiz 2021-11-30 05:25:48 +01:00 committed by GitHub
parent f96d3384e8
commit 444011ff64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -41,6 +41,7 @@ import org.compiere.model.X_AD_PrintFormat;
import org.compiere.model.X_AD_PrintFormatItem;
import org.compiere.print.MPrintFormat;
import org.compiere.print.MPrintFormatItem;
import org.compiere.print.MPrintPaper;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.xml.sax.SAXException;
@ -101,10 +102,13 @@ public class PrintFormatElementHandler extends AbstractElementHandler {
MPrintFormat m_Printformat = new MPrintFormat(ctx.ctx, AD_PrintFormat_ID, null);
if (m_Printformat.getAD_PrintPaper_ID() > 0) {
try {
ctx.packOut.getHandler(I_AD_PrintPaper.Table_Name).packOut(ctx.packOut, document, ctx.logDocument, m_Printformat.getAD_PrintPaper_ID());
} catch (Exception e) {
throw new SAXException(e);
MPrintPaper pp = MPrintPaper.get(m_Printformat.getAD_PrintPaper_ID());
if (pp.getAD_Client_ID() == m_Printformat.getAD_Client_ID()) {
try {
ctx.packOut.getHandler(I_AD_PrintPaper.Table_Name).packOut(ctx.packOut, document, ctx.logDocument, m_Printformat.getAD_PrintPaper_ID());
} catch (Exception e) {
throw new SAXException(e);
}
}
}