From 16074d80ee742c5ce0bd7d42ccb72aeea1af2283 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 13 Feb 2024 07:47:01 +0100 Subject: [PATCH] IDEMPIERE-6039 MBPartnerLocation returning Location wrongly from cache when asked to requery (#2240) --- .../src/org/compiere/model/MBPartnerLocation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java index 3a4234c880..d9afbf5ba6 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java @@ -195,12 +195,14 @@ public class MBPartnerLocation extends X_C_BPartner_Location { /** * Get Location/Address * - * @param requery get again the location from DB - please note that if used out of transaction the result is get from the cache + * @param requery get again the location from DB * @return location */ public MLocation getLocation(boolean requery) { if (requery || m_location == null) m_location = MLocation.getCopy(getCtx(), getC_Location_ID(), get_TrxName()); + if (requery && m_location != null) + m_location.load(get_TrxName()); return m_location; } // getLocation