From 2f9d6e74e6d9c11aef07070268a59cc54b1e3970 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 23 Jun 2008 21:31:37 +0000 Subject: [PATCH] Small performance improvement on Payment completion - don't rewrite a valid value (avoid save/check cycle) --- base/src/org/compiere/model/MPeriod.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/base/src/org/compiere/model/MPeriod.java b/base/src/org/compiere/model/MPeriod.java index e74e25a1cc..30245e8e96 100644 --- a/base/src/org/compiere/model/MPeriod.java +++ b/base/src/org/compiere/model/MPeriod.java @@ -411,8 +411,10 @@ public class MPeriod extends X_C_Period // We are OK if (isInPeriod(today)) { - as.setC_Period_ID(getC_Period_ID()); - as.save(); + if (as.getC_Period_ID() != getC_Period_ID()) { + as.setC_Period_ID(getC_Period_ID()); + as.save(); + } } return true; }