Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014986Openbravo ERP01. General setuppublic2010-10-22 11:122010-12-21 00:00
egoitz 
adrianromero 
urgentmajorrandom
closedfixed 
5
2.50MP22 
2.50MP25 
Core
No
0014986: In some special cases you could apply the same dataset multiple times
In some special cases you could apply the same dataset multiple times.
When this happens you get duplicate rows which should not happen
-Create a module with dataset that inserts an accounting process
Financial Management || Accounting || Setup || Accounting Schema || Accounting
Schema >> Process
-Install the module in other application
-login into same instance with two browasers
-open the window in both browsers
-then press ok in both browsers -> will apply twice
-as it seems the check to see if a dataset is alrady applied is only done when opening the window and should (also) be done when pressing ok
No tags attached.
Issue History
2010-10-22 11:12egoitzNew Issue
2010-10-22 11:12egoitzAssigned To => dalsasua
2010-10-22 11:13egoitzIssue Monitored: networkb
2010-10-22 11:53egoitzSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=1120#r1120
2010-10-28 20:08shuehnerIssue Monitored: shuehner
2010-11-17 17:48dalsasuaAssigned Todalsasua => adrianromero
2010-11-30 13:21adrianromeroNote Added: 0032913
2010-12-01 18:12hgbotCheckin
2010-12-01 18:12hgbotNote Added: 0032988
2010-12-01 18:12hgbotStatusnew => resolved
2010-12-01 18:12hgbotResolutionopen => fixed
2010-12-01 18:12hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0a0215b9cd0b2ab59b911338071afa4bf5401910 [^]
2010-12-01 18:19adrianromeroNote Added: 0032990
2010-12-02 07:28hudsonbotCheckin
2010-12-02 07:28hudsonbotNote Added: 0032997
2010-12-20 17:51egoitzNote Added: 0033310
2010-12-20 17:51egoitzStatusresolved => closed
2010-12-21 00:00anonymoussf_bug_id0 => 3140997

Notes
(0032913)
adrianromero   
2010-11-30 13:21   
The problem is in the class UpdateReferenceData method updateReferenceData:

https://code.openbravo.com/erp/devel/pi/file/0bd66b4ea209/src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java#l180 [^]

The problem is that here is not verified whether the reference data has been applied previously or not. It is required to add a check for each Reference data applied in this method to not to apply a reference data if it has been applied before, and display an error in this case saying that this reference data has been applied previously.

This check has to be done before calling the function that actually imports the reference data:

https://code.openbravo.com/erp/devel/pi/file/0bd66b4ea209/src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java#l216 [^]

Have a look also how it is updated that the reference data has been applied in the database:

https://code.openbravo.com/erp/devel/pi/file/0bd66b4ea209/src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java#l248 [^] and
https://code.openbravo.com/erp/devel/pi/file/0bd66b4ea209/src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java#l251 [^]
(0032988)
hgbot   
2010-12-01 18:12   
Repository: erp/devel/pi
Changeset: 0a0215b9cd0b2ab59b911338071afa4bf5401910
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Wed Dec 01 18:10:51 2010 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0a0215b9cd0b2ab59b911338071afa4bf5401910 [^]

Fixes issue 0014986: In some special cases you could apply the same dataset multiple times
It has been added a condition that verifies if the reference data has been created before executing the process, and in this case displaying a message accordingly

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java
M src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData_data.xsql
---
(0032990)
adrianromero   
2010-12-01 18:19   
* Testing the issue

Follow the steps to reproduce, open two different browsers in the process window General Setup || Enterprise || Enterprise module management || Enterprise model management . Select the same reference data and execute the process that creates the reference data in one of them. Go to the other page and try to execute the process on the same reference data.

The process will succeed but for the duplicated reference data files the following message will be displayed:

0014986: In some special cases you could apply the same dataset multiple times

* Other areas affected

No other areas affected the condition has only been added to the Enterprise module management window.
(0032997)
hudsonbot   
2010-12-02 07:28   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/0a0215b9cd0b [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/e4361f8233c4 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.19060.obx [^]
(0033310)
egoitz   
2010-12-20 17:51   
Tested on main.