diff --git a/org.adempiere.base/src/org/compiere/model/MMeasure.java b/org.adempiere.base/src/org/compiere/model/MMeasure.java index 2210fc5f4e..aac86ad6d4 100644 --- a/org.adempiere.base/src/org/compiere/model/MMeasure.java +++ b/org.adempiere.base/src/org/compiere/model/MMeasure.java @@ -109,6 +109,8 @@ public class MMeasure extends X_PA_Measure String sql = mc.getSqlBarChart(goal.getRestrictions(false), goal.getMeasureDisplay(), goal.getDateFrom(), MRole.getDefault()); // logged in role + if (sql.indexOf("@") >= 0) + sql = Env.parseContext(getCtx(), 0, sql, false, false); PreparedStatement pstmt = null; ResultSet rs = null; try diff --git a/org.adempiere.base/src/org/compiere/model/MMeasureCalc.java b/org.adempiere.base/src/org/compiere/model/MMeasureCalc.java index 8f86fa39c5..ccc13d6096 100644 --- a/org.adempiere.base/src/org/compiere/model/MMeasureCalc.java +++ b/org.adempiere.base/src/org/compiere/model/MMeasureCalc.java @@ -235,6 +235,8 @@ public class MMeasureCalc extends X_PA_MeasureCalc .append("')=TRUNC(").append(DB.TO_DATE(date)).append(",'").append(trunc).append("')"); } String finalSQL = addRestrictions(sql.toString(), restrictions, role); + if (finalSQL.indexOf("@") >= 0) + finalSQL = Env.parseContext(getCtx(), 0, finalSQL, false, false); // Execute StringBuilder where = new StringBuilder(); PreparedStatement pstmt = null;