Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0018773Openbravo ERPZ. Otherspublic2011-10-13 17:182011-11-04 11:08
mirurita 
gorkaion 
normalmajoralways
closedfixed 
5
 
 
Core
No
0018773: Violated constraint fin_finacc_paymentmethod_un when you try to migrate a multicurrency debt payment (Settlement step)
In Settlement step if the process tries to migrate a multicurrency debt payment it creates specific payment method and associates to the financial account.

As the flush() is not done, when checking if the payment method already exists in the financial account the query returns false and tries to insert again.
                                     
"Entity: FinancialMgmtDebtPayment. Entidad: Operon. Información de registro: false - GL-LOHMANN - Lohmann Precision Die Cutting, LCC - P - -2073.32000 - 14-09-2010
Entity: FinancialMgmtDebtPayment. Entidad: Operon. Información de registro: false - GL-LOHMANN - Lohmann Precision Die Cutting, LCC - P - -2073.32000 - 14-09-2010
Entity: FinancialMgmtDebtPayment. Entidad: Operon. Información de registro: false - GL-LOHMANN - Lohmann Precision Die Cutting, LCC - P - -2073.32000 - 14-09-2010

ERROR: duplicate key value violates unique constraint "fin_finacc_paymentmethod_un"
org.openbravo.erputil.aprmigrationtool.utility.MigrationException: ERROR: duplicate key value violates unique constraint "fin_finacc_paymentmethod_un"
    at org.openbravo.erputil.aprmigrationtool.entity.MigrateSettlementPayments.migrateClient(MigrateSettlementPayments.java:83)
    at org.openbravo.erputil.aprmigrationtool.entity.Entity.migrate(Entity.java:97)
    at org.openbravo.erputil.aprmigrationtool.entity.MigrationTool.migrationProcess(MigrationTool.java:91)
    at org.openbravo.erputil.aprmigrationtool.ad_forms.MigrationTool.process(MigrationTool.java:177)
    at org.openbravo.erputil.aprmigrationtool.ad_forms.MigrationTool.doPost(MigrationTool.java:67)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:429)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:429)
    at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:384)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
    at java.lang.Thread.run(Thread.java:662)
1) Create a multicurrency debt payment in 2.50 without APR
2) Install migration tool
3) Launch migration process
org.openbravo.erputil.aprmigrationtool.entity.MigrateSettlementPayments

after the following line
OBDal.getInstance().save(multicurrencyPaymentMethod);
insert
OBDal.getInstance().flush();

and in the line 344, after
OBDal.getInstance().save(accountPay);
insert again
OBDal.getInstance().flush();
No tags attached.
related to defect 0019237 new gorkaion Modules cannot migrate a manual settlement in a foreign currency 
Issue History
2011-10-13 17:18miruritaNew Issue
2011-10-13 17:18miruritaAssigned To => gorkaion
2011-10-13 17:18miruritaModules => Core
2011-10-13 17:18miruritaResolution time => 1321311600
2011-10-17 10:35jonalegriaesarteNote Added: 0041845
2011-10-17 10:35jonalegriaesarteSeveritycritical => major
2011-10-17 10:35jonalegriaesarteDescription Updatedbug_revision_view_page.php?rev_id=2817#r2817
2011-10-27 15:55hgbotCheckin
2011-10-27 15:55hgbotNote Added: 0042155
2011-10-27 15:55hgbotStatusnew => resolved
2011-10-27 15:55hgbotResolutionopen => fixed
2011-10-27 15:55hgbotFixed in SCM revision => http://code.openbravo.com/erp/mods/org.openbravo.erputil.aprmigrationtool/rev/760dfdd1c99909c9f3c825a21da94c69e5829137 [^]
2011-11-04 11:08miruritaNote Added: 0042522
2011-11-04 11:08miruritaStatusresolved => closed
2011-12-02 16:58dalsasuaRelationship addedrelated to 0019237

Notes
(0041845)
jonalegriaesarte   
2011-10-17 10:35   
Updated to major because it is solved in customer side
(0042155)
hgbot   
2011-10-27 15:55   
Repository: erp/mods/org.openbravo.erputil.aprmigrationtool
Changeset: 760dfdd1c99909c9f3c825a21da94c69e5829137
Author: Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
Date: Thu Oct 27 15:53:48 2011 +0200
URL: http://code.openbravo.com/erp/mods/org.openbravo.erputil.aprmigrationtool/rev/760dfdd1c99909c9f3c825a21da94c69e5829137 [^]

Fixed issue 18773.Add flushes when payment method is created.

---
M src/org/openbravo/erputil/aprmigrationtool/dao/MigrationToolDao.java
---
(0042522)
mirurita   
2011-11-04 11:08   
Detected and verified in a *Phoenix* client migration.