From ef333ae53f12e7a298388f45d4b3a6e8637fed09 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 7 Aug 2007 18:30:33 +0000 Subject: [PATCH] Fix Bug [ 1769579 ] PO.equals comparison wrong for new records --- base/src/org/compiere/model/PO.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/src/org/compiere/model/PO.java b/base/src/org/compiere/model/PO.java index b7f2a70539..fb9bff0ef6 100644 --- a/base/src/org/compiere/model/PO.java +++ b/base/src/org/compiere/model/PO.java @@ -231,7 +231,11 @@ public abstract class PO if (!(cmp instanceof PO)) return false; if (cmp.getClass().equals(this.getClass())) - return ((PO)cmp).get_ID() == get_ID(); + // if both ID's are zero they can't be compared by ID + if (((PO)cmp).get_ID() == 0 && get_ID() == 0) + return super.equals(cmp); + else + return ((PO)cmp).get_ID() == get_ID(); return super.equals(cmp); } // equals