From b56a83ff55232423c1cf243d387a73ae6257373a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 21 Feb 2017 08:50:03 +0100 Subject: [PATCH] IDEMPIERE-3302 Enable user preferences as context logic --- org.adempiere.base/src/org/compiere/util/Env.java | 2 +- org.adempiere.base/src/org/compiere/util/Evaluator.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/util/Env.java b/org.adempiere.base/src/org/compiere/util/Env.java index c0be165330..c8448b4eab 100644 --- a/org.adempiere.base/src/org/compiere/util/Env.java +++ b/org.adempiere.base/src/org/compiere/util/Env.java @@ -549,7 +549,7 @@ public final class Env if (s == null) { // Explicit Base Values - if (context.startsWith("#") || context.startsWith("$")) + if (context.startsWith("#") || context.startsWith("$") || context.startsWith("P|")) return getContext(ctx, context); if (onlyWindow) // no Default values return ""; diff --git a/org.adempiere.base/src/org/compiere/util/Evaluator.java b/org.adempiere.base/src/org/compiere/util/Evaluator.java index 04379437fb..9b56b85b5d 100644 --- a/org.adempiere.base/src/org/compiere/util/Evaluator.java +++ b/org.adempiere.base/src/org/compiere/util/Evaluator.java @@ -98,7 +98,7 @@ public class Evaluator } String exprStrand = st.nextToken().trim(); - if (exprStrand.matches("^@\\d+$")) + if (exprStrand.matches("^@\\d+$") || "@P".equals(exprStrand)) { exprStrand = exprStrand.concat(st.nextToken()); exprStrand = exprStrand.concat(st.nextToken()); @@ -112,7 +112,7 @@ public class Evaluator //boolean temp = evaluateLogicTuple(source, st.nextToken()); exprStrand = st.nextToken().trim(); - if (exprStrand.matches("^@\\d+$")) + if (exprStrand.matches("^@\\d+$") || "@P".equals(exprStrand)) { exprStrand = exprStrand.concat(st.nextToken()); exprStrand = exprStrand.concat(st.nextToken());