diff --git a/base/src/org/compiere/model/MAllocationHdr.java b/base/src/org/compiere/model/MAllocationHdr.java index af9e51719d..2ada5f76a7 100644 --- a/base/src/org/compiere/model/MAllocationHdr.java +++ b/base/src/org/compiere/model/MAllocationHdr.java @@ -199,8 +199,12 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction */ public MAllocationLine[] getLines (boolean requery) { - if (m_lines != null && m_lines.length != 0 && !requery) - return m_lines; + if (m_lines != null && m_lines.length != 0 && !requery) { + if (m_lines != null && m_lines.length != 0 && !requery) { + set_TrxName(m_lines, get_TrxName()); + return m_lines; + } + } // String sql = "SELECT * FROM C_AllocationLine WHERE C_AllocationHdr_ID=?"; ArrayList list = new ArrayList(); diff --git a/base/src/org/compiere/model/MBankStatement.java b/base/src/org/compiere/model/MBankStatement.java index e36629a51b..0e85e8aea9 100644 --- a/base/src/org/compiere/model/MBankStatement.java +++ b/base/src/org/compiere/model/MBankStatement.java @@ -103,8 +103,10 @@ public class MBankStatement extends X_C_BankStatement implements DocAction */ public MBankStatementLine[] getLines (boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } // ArrayList list = new ArrayList(); String sql = "SELECT * FROM C_BankStatementLine " diff --git a/base/src/org/compiere/model/MCash.java b/base/src/org/compiere/model/MCash.java index 4f4b7fbe03..d3297014d8 100644 --- a/base/src/org/compiere/model/MCash.java +++ b/base/src/org/compiere/model/MCash.java @@ -239,8 +239,10 @@ public class MCash extends X_C_Cash implements DocAction */ public MCashLine[] getLines (boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } ArrayList list = new ArrayList(); String sql = "SELECT * FROM C_CashLine WHERE C_Cash_ID=? ORDER BY Line"; PreparedStatement pstmt = null; diff --git a/base/src/org/compiere/model/MDiscountSchema.java b/base/src/org/compiere/model/MDiscountSchema.java index 8ccb7e3f25..4d3b999f56 100644 --- a/base/src/org/compiere/model/MDiscountSchema.java +++ b/base/src/org/compiere/model/MDiscountSchema.java @@ -140,8 +140,10 @@ public class MDiscountSchema extends X_M_DiscountSchema */ public MDiscountSchemaLine[] getLines(boolean reload) { - if (m_lines != null && !reload) + if (m_lines != null && !reload) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } String sql = "SELECT * FROM M_DiscountSchemaLine WHERE M_DiscountSchema_ID=? ORDER BY SeqNo"; ArrayList list = new ArrayList(); diff --git a/base/src/org/compiere/model/MDistribution.java b/base/src/org/compiere/model/MDistribution.java index 3f1b396b4b..95ddac3af5 100644 --- a/base/src/org/compiere/model/MDistribution.java +++ b/base/src/org/compiere/model/MDistribution.java @@ -243,8 +243,10 @@ public class MDistribution extends X_GL_Distribution */ public MDistributionLine[] getLines (boolean reload) { - if (m_lines != null && !reload) + if (m_lines != null && !reload) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } BigDecimal PercentTotal = Env.ZERO; ArrayList list = new ArrayList(); diff --git a/base/src/org/compiere/model/MDistributionRun.java b/base/src/org/compiere/model/MDistributionRun.java index 8c45ca935d..350a5ef3a4 100644 --- a/base/src/org/compiere/model/MDistributionRun.java +++ b/base/src/org/compiere/model/MDistributionRun.java @@ -62,8 +62,10 @@ public class MDistributionRun extends X_M_DistributionRun */ public MDistributionRunLine[] getLines (boolean reload) { - if (!reload && m_lines != null) + if (!reload && m_lines != null) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } // String sql = "SELECT * FROM M_DistributionRunLine " + "WHERE M_DistributionRun_ID=? AND IsActive='Y' AND TotalQty IS NOT NULL AND TotalQty<> 0 ORDER BY Line"; diff --git a/base/src/org/compiere/model/MInOut.java b/base/src/org/compiere/model/MInOut.java index 7344ae891c..f454505b2c 100644 --- a/base/src/org/compiere/model/MInOut.java +++ b/base/src/org/compiere/model/MInOut.java @@ -540,8 +540,10 @@ public class MInOut extends X_M_InOut implements DocAction */ public MInOutLine[] getLines (boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } ArrayList list = new ArrayList(); String sql = "SELECT * FROM M_InOutLine WHERE M_InOut_ID=? ORDER BY Line"; PreparedStatement pstmt = null; diff --git a/base/src/org/compiere/model/MInOutConfirm.java b/base/src/org/compiere/model/MInOutConfirm.java index 717892267e..fa295e080c 100644 --- a/base/src/org/compiere/model/MInOutConfirm.java +++ b/base/src/org/compiere/model/MInOutConfirm.java @@ -131,8 +131,10 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction */ public MInOutLineConfirm[] getLines (boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } String sql = "SELECT * FROM M_InOutLineConfirm " + "WHERE M_InOutConfirm_ID=?"; ArrayList list = new ArrayList(); diff --git a/base/src/org/compiere/model/MInventory.java b/base/src/org/compiere/model/MInventory.java index 5601fcdd4b..2c1c443ea3 100644 --- a/base/src/org/compiere/model/MInventory.java +++ b/base/src/org/compiere/model/MInventory.java @@ -110,8 +110,10 @@ public class MInventory extends X_M_Inventory implements DocAction */ public MInventoryLine[] getLines (boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } // ArrayList list = new ArrayList(); String sql = "SELECT * FROM M_InventoryLine WHERE M_Inventory_ID=? ORDER BY Line"; diff --git a/base/src/org/compiere/model/MInvoice.java b/base/src/org/compiere/model/MInvoice.java index 007336a45a..12ff71a6ac 100644 --- a/base/src/org/compiere/model/MInvoice.java +++ b/base/src/org/compiere/model/MInvoice.java @@ -639,6 +639,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { if (m_lines == null || m_lines.length == 0 || requery) m_lines = getLines(null); + set_TrxName(m_lines, get_TrxName()); return m_lines; } // getLines diff --git a/base/src/org/compiere/model/MInvoiceBatch.java b/base/src/org/compiere/model/MInvoiceBatch.java index d0dabbb180..5d628bbd4f 100644 --- a/base/src/org/compiere/model/MInvoiceBatch.java +++ b/base/src/org/compiere/model/MInvoiceBatch.java @@ -75,8 +75,10 @@ public class MInvoiceBatch extends X_C_InvoiceBatch */ public MInvoiceBatchLine[] getLines (boolean reload) { - if (m_lines != null && !reload) + if (m_lines != null && !reload) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } String sql = "SELECT * FROM C_InvoiceBatchLine WHERE C_InvoiceBatch_ID=? ORDER BY Line"; ArrayList list = new ArrayList(); PreparedStatement pstmt = null; diff --git a/base/src/org/compiere/model/MMovement.java b/base/src/org/compiere/model/MMovement.java index 274ccf1688..0e431eed41 100644 --- a/base/src/org/compiere/model/MMovement.java +++ b/base/src/org/compiere/model/MMovement.java @@ -77,8 +77,10 @@ public class MMovement extends X_M_Movement implements DocAction */ public MMovementLine[] getLines (boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } // ArrayList list = new ArrayList(); String sql = "SELECT * FROM M_MovementLine WHERE M_Movement_ID=? ORDER BY Line"; diff --git a/base/src/org/compiere/model/MMovementConfirm.java b/base/src/org/compiere/model/MMovementConfirm.java index 1c5d1d60ac..d4b3e8b61b 100644 --- a/base/src/org/compiere/model/MMovementConfirm.java +++ b/base/src/org/compiere/model/MMovementConfirm.java @@ -122,8 +122,10 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction */ public MMovementLineConfirm[] getLines (boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } String sql = "SELECT * FROM M_MovementLineConfirm " + "WHERE M_MovementConfirm_ID=?"; ArrayList list = new ArrayList(); diff --git a/base/src/org/compiere/model/MOrder.java b/base/src/org/compiere/model/MOrder.java index 1f778c38e0..347b5f4c1c 100644 --- a/base/src/org/compiere/model/MOrder.java +++ b/base/src/org/compiere/model/MOrder.java @@ -645,8 +645,10 @@ public class MOrder extends X_C_Order implements DocAction */ public MOrderLine[] getLines (boolean requery, String orderBy) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } // String orderClause = "ORDER BY "; if (orderBy != null && orderBy.length() > 0) diff --git a/base/src/org/compiere/model/MPaySelection.java b/base/src/org/compiere/model/MPaySelection.java index 1745f4b015..83de94ae08 100644 --- a/base/src/org/compiere/model/MPaySelection.java +++ b/base/src/org/compiere/model/MPaySelection.java @@ -73,8 +73,10 @@ public class MPaySelection extends X_C_PaySelection */ public MPaySelectionLine[] getLines(boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } ArrayList list = new ArrayList(); String sql = "SELECT * FROM C_PaySelectionLine WHERE C_PaySelection_ID=? ORDER BY Line"; PreparedStatement pstmt = null; diff --git a/base/src/org/compiere/model/MRMA.java b/base/src/org/compiere/model/MRMA.java index f2496ca439..f9ea3e4326 100644 --- a/base/src/org/compiere/model/MRMA.java +++ b/base/src/org/compiere/model/MRMA.java @@ -79,8 +79,10 @@ public class MRMA extends X_M_RMA implements DocAction */ public MRMALine[] getLines (boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } ArrayList list = new ArrayList(); String sql = "SELECT * FROM M_RMALine WHERE M_RMA_ID=?"; diff --git a/base/src/org/compiere/model/MRequisition.java b/base/src/org/compiere/model/MRequisition.java index 27b1cd6927..5d55f548ed 100644 --- a/base/src/org/compiere/model/MRequisition.java +++ b/base/src/org/compiere/model/MRequisition.java @@ -77,8 +77,10 @@ public class MRequisition extends X_M_Requisition implements DocAction */ public MRequisitionLine[] getLines() { - if (m_lines != null) + if (m_lines != null) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } ArrayList list = new ArrayList(); String sql = "SELECT * FROM M_RequisitionLine WHERE M_Requisition_ID=? ORDER BY Line"; diff --git a/base/src/org/compiere/model/MRfQResponse.java b/base/src/org/compiere/model/MRfQResponse.java index 82a7b6f297..6a29fb56cc 100644 --- a/base/src/org/compiere/model/MRfQResponse.java +++ b/base/src/org/compiere/model/MRfQResponse.java @@ -147,8 +147,10 @@ public class MRfQResponse extends X_C_RfQResponse */ public MRfQResponseLine[] getLines(boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } ArrayList list = new ArrayList(); String sql = "SELECT * FROM C_RfQResponseLine " + "WHERE C_RfQResponse_ID=? AND IsActive='Y'"; diff --git a/base/src/org/compiere/model/MTimeExpense.java b/base/src/org/compiere/model/MTimeExpense.java index 8bde3416a4..abf0b0cf85 100644 --- a/base/src/org/compiere/model/MTimeExpense.java +++ b/base/src/org/compiere/model/MTimeExpense.java @@ -89,8 +89,10 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction */ public MTimeExpenseLine[] getLines (boolean requery) { - if (m_lines != null && !requery) + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); return m_lines; + } // int C_Currency_ID = getC_Currency_ID(); ArrayList list = new ArrayList(); diff --git a/base/src/org/compiere/model/PO.java b/base/src/org/compiere/model/PO.java index 1b7c536a0e..cd0b311b39 100644 --- a/base/src/org/compiere/model/PO.java +++ b/base/src/org/compiere/model/PO.java @@ -3586,6 +3586,15 @@ public abstract class PO */ public Doc getDoc() { return m_doc; - } + } + + /** + * PO.setTrxName - set given trxName to an array of POs + * As suggested by teo in [ 1854603 ] + */ + public static void set_TrxName(PO[] lines, String trxName) { + for (PO line : lines) + line.set_TrxName(trxName); + } } // PO