details:   https://code.openbravo.com/erp/devel/pi/rev/32831d5765d1
changeset: 13896:32831d5765d1
user:      Javier Etxarri <javier.echarri <at> openbravo.com>
date:      Fri Sep 30 12:31:24 2011 +0200
summary:   Fixes issue 18474: sequence number is reset when a dataset include a 
sequence with the same name

diffstat:

 src/org/openbravo/dal/xml/BaseXMLEntityConverter.java |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r 49c0de1828a4 -r 32831d5765d1 
src/org/openbravo/dal/xml/BaseXMLEntityConverter.java
--- a/src/org/openbravo/dal/xml/BaseXMLEntityConverter.java     Fri Sep 30 
12:03:19 2011 +0200
+++ b/src/org/openbravo/dal/xml/BaseXMLEntityConverter.java     Fri Sep 30 
12:31:24 2011 +0200
@@ -161,8 +161,11 @@
   // if there is a matching object in the db then that one should be
   // used
   protected BaseOBObject replaceByUniqueObject(BaseOBObject bob) {
+    BaseOBObject otherUniqueObject = null;
     if (bob.isNewOBObject() && bob.getEntity().getUniqueConstraints().size() > 
0) {
-      final BaseOBObject otherUniqueObject = 
entityResolver.findUniqueConstrainedObject(bob);
+      if ("".equals(bob.getId()) || bob.getId() == null) {
+        otherUniqueObject = entityResolver.findUniqueConstrainedObject(bob);
+      }
       if (otherUniqueObject != null && otherUniqueObject != bob) {
         // now copy the imported values from the bob to
         // otherUniqueObject

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to