Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023990Openbravo ERPA. Platformpublic2013-06-05 11:312013-07-16 14:26
vmromanos 
AugustoMauch 
immediatemajorsometimes
closedfixed 
20Debian 5.0
3.0MP21.1 
3.0MP25 
shankarb
Core
No
0023990: Permission error when applying datasets
I'm getting a random error related to permissions when applying the core's dataset from either the Initial Org Setup or the Enterprise Module Management:

Entity RFC Order (DocumentType) with organization Org1 references an entity Return Material Sales Invoice through its property documentTypeForInvoice but this referenced entity belongs to an organization Org2 which is not part of the natural tree of Org1


I have been able to reproduce it in MPs greater than MP20 at live.builds instances.

I'm not sure whether it's a regression or not due to the random behaviour, but my feeling is that this process worked fine in the past.
1. Create a new client running the Initial Client Setup.
   Do NOT include accounting
   IMPORTANT: do NOT include any dataset
   A confirmation message is shown. Press OK
2. Log into the new client and run an Initial Org Setup
   Org name: Org1
   Org type: generic
   Parent org: *
   Do NOT include accounting
   IMPORTANT: select dataset: Standard document types for orders, invoices, etc. and settings - Core - English (USA)
   Press OK
3. Create another organization from the Initial Org Setup
   Org name: Org2
   Org type: generic
   Parent org: *
   Do NOT include accounting
   IMPORTANT: select dataset: Standard document types for orders, invoices, etc. and settings - Core - English (USA)
   Press OK

The following error is raised:
Entity RFC Order (DocumentType) with organization Org1 references an entity Return Material Sales Invoice through its property documentTypeForInvoice but this referenced entity belongs to an organization Org2 which is not part of the natural tree of Org1


You can also try to create another organization without selecting any dataset, and after that apply the core's one at the Enterprise Module Management. A similar error appears (see attachment)
   
No tags attached.
related to defect 00217163.0MP16 closed AugustoMauch REST Webservice PUT Method not find objects for * 
related to defect 0023801 closed AugustoMauch XML REST Webservices identifier property is not working 
related to defect 0023992 acknowledged Triage Platform Base Error applying coworking dataset in Enterprise Module Management 
related to defect 00242313.0MP26 closed AugustoMauch Impossible to apply more than 2 times a dataset 
png dataset_permission_error.png (87,866) 2013-06-05 11:31
https://issues.openbravo.com/file_download.php?file_id=6174&type=bug
png
Issue History
2013-06-05 11:31vmromanosNew Issue
2013-06-05 11:31vmromanosAssigned To => AugustoMauch
2013-06-05 11:31vmromanosFile Added: dataset_permission_error.png
2013-06-05 11:31vmromanosModules => Core
2013-06-05 11:31vmromanosTriggers an Emergency Pack => No
2013-06-05 11:36vmromanosNote Added: 0059178
2013-06-05 12:33vmromanosRelationship addedrelated to 0023992
2013-06-10 11:48AugustoMauchIssue Monitored: shankarb
2013-06-10 11:48AugustoMauchReview Assigned To => shankarb
2013-06-10 11:49AugustoMauchRelationship addedrelated to 0021716
2013-06-10 11:50AugustoMauchRelationship addedrelated to 0023801
2013-06-10 11:51AugustoMauchNote Added: 0059290
2013-06-10 11:52hgbotCheckin
2013-06-10 11:52hgbotNote Added: 0059291
2013-06-10 11:52hgbotStatusnew => resolved
2013-06-10 11:52hgbotResolutionopen => fixed
2013-06-10 11:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0762572868aa6f2fa3186460a80c3cbff7cb634a [^]
2013-06-10 12:51hgbotCheckin
2013-06-10 12:51hgbotNote Added: 0059295
2013-06-10 12:51AugustoMauchStatusresolved => new
2013-06-10 12:51AugustoMauchResolutionfixed => open
2013-06-10 17:28ngarciaIssue Monitored: ngarcia
2013-06-11 12:37hgbotCheckin
2013-06-11 12:37hgbotNote Added: 0059331
2013-06-11 12:37hgbotStatusnew => resolved
2013-06-11 12:37hgbotResolutionopen => fixed
2013-06-11 12:37hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/0762572868aa6f2fa3186460a80c3cbff7cb634a [^] => http://code.openbravo.com/erp/devel/pi/rev/0047a4f2ebbac184b429674b2057645cfc1be0f0 [^]
2013-06-11 18:29hgbotCheckin
2013-06-11 18:29hgbotNote Added: 0059373
2013-06-11 18:30AugustoMauchStatusresolved => new
2013-06-11 18:30AugustoMauchResolutionfixed => open
2013-06-18 20:13hgbotCheckin
2013-06-18 20:13hgbotNote Added: 0059507
2013-06-18 20:13hgbotStatusnew => resolved
2013-06-18 20:13hgbotResolutionopen => fixed
2013-06-18 20:13hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/0047a4f2ebbac184b429674b2057645cfc1be0f0 [^] => http://code.openbravo.com/erp/devel/pi/rev/83447d2c67e21ac06ca92c1d2ec432d5e9e2656a [^]
2013-06-19 10:15shankarbNote Added: 0059517
2013-06-19 10:15shankarbStatusresolved => closed
2013-06-19 10:15shankarbFixed in Version => 3.0MP25
2013-06-20 02:07hudsonbotCheckin
2013-06-20 02:07hudsonbotNote Added: 0059558
2013-06-20 02:07hudsonbotCheckin
2013-06-20 02:07hudsonbotNote Added: 0059559
2013-06-20 02:08hudsonbotCheckin
2013-06-20 02:08hudsonbotNote Added: 0059565
2013-06-20 02:08hudsonbotCheckin
2013-06-20 02:08hudsonbotNote Added: 0059570
2013-06-20 02:08hudsonbotCheckin
2013-06-20 02:08hudsonbotNote Added: 0059588
2013-07-02 18:22AugustoMauchRelationship addedrelated to 0024231
2013-07-02 18:29hgbotCheckin
2013-07-02 18:29hgbotNote Added: 0059820
2013-07-16 14:26hudsonbotCheckin
2013-07-16 14:26hudsonbotNote Added: 0060012

Notes
(0059178)
vmromanos   
2013-06-05 11:36   
In an ondemand machine running MP23, I'm getting a different behaviour from the one reported into the steps to reproduce section.
Instead of showing that error message, the process ends successfully but the log says that 0 rows were inserted or updated for this dataset (which is also wrong):

Processing module Core
ProcessingDataset Initial Setup
0 row/s inserted
0 row/s updated

Create reference data process completed successfully
(0059290)
AugustoMauch   
2013-06-10 11:51   
Test plan:
- Test that this issue is no longer reproducible
- Test that the issue 21716 is not reproducible
- Test that the issue 23801 is not reproducible
(0059291)
hgbot   
2013-06-10 11:52   
Repository: erp/devel/pi
Changeset: 0762572868aa6f2fa3186460a80c3cbff7cb634a
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Jun 10 11:48:00 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/0762572868aa6f2fa3186460a80c3cbff7cb634a [^]

Fixes issue 23990: XML is imported properly using Initial Org Setup

This is what was happening when an object with id #id was being imported from a dataset to a organization. #id is the id of the object in the dataset
- The first time the object is imported to a organization (org1), the original #id is used
- When the same record was being imported to a sister organization (org2), a query for that object with the id #id was done. The organization filter was not being applied, so the object that was imported in the previous step was found. This object was related with other objects that belonged to org1, but was being referenced too from other objects that were belonged to org2. org1 is not part of the natural tree of org2, so an exception was thrown.

This has been fixed by adding a parameter to the resolve method that will force to apply the organization filter. The default value of this parameter is false, and it will only be true then is called from the InitialSetupUtility class.

---
M src/org/openbravo/dal/xml/BaseXMLEntityConverter.java
M src/org/openbravo/dal/xml/EntityResolver.java
M src/org/openbravo/dal/xml/XMLEntityConverter.java
M src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java
M src/org/openbravo/service/db/DataImportService.java
---
(0059295)
hgbot   
2013-06-10 12:51   
Repository: erp/devel/pi
Changeset: 51fcf57a7be2ae01f3781dbdf6a7bff9ead4503a
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Jun 10 12:50:49 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/51fcf57a7be2ae01f3781dbdf6a7bff9ead4503a [^]

Related with issue 23990: Backed out changeset 0762572868aa

The fix has been backed out because it break the automated tests

---
M src/org/openbravo/dal/xml/BaseXMLEntityConverter.java
M src/org/openbravo/dal/xml/EntityResolver.java
M src/org/openbravo/dal/xml/XMLEntityConverter.java
M src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java
M src/org/openbravo/service/db/DataImportService.java
---
(0059331)
hgbot   
2013-06-11 12:37   
Repository: erp/devel/pi
Changeset: 0047a4f2ebbac184b429674b2057645cfc1be0f0
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 11 12:36:37 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/0047a4f2ebbac184b429674b2057645cfc1be0f0 [^]

Fixes issue 23990: XML is imported properly using Initial Org Setup

Same fix as changeset 0020531, the only difference being that now it has been taking into account the class ClientImportEntityResolver, which extends EntityResolver and which needed to override also the new resolve method with 4 parameters.

---
M src/org/openbravo/dal/xml/BaseXMLEntityConverter.java
M src/org/openbravo/dal/xml/EntityResolver.java
M src/org/openbravo/dal/xml/XMLEntityConverter.java
M src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java
M src/org/openbravo/service/db/ClientImportEntityResolver.java
M src/org/openbravo/service/db/DataImportService.java
---
(0059373)
hgbot   
2013-06-11 18:29   
Repository: erp/devel/pi
Changeset: 1af72d899d84ec7e8e735aeff9047c893da4e827
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 11 18:28:22 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1af72d899d84ec7e8e735aeff9047c893da4e827 [^]

Related to issue 23990: changed backed out because it breaks the tests

http://builds.openbravo.com/job/int-smoke-pgsql-test/992/ [^]

---
M src/org/openbravo/dal/xml/BaseXMLEntityConverter.java
M src/org/openbravo/dal/xml/EntityResolver.java
M src/org/openbravo/dal/xml/XMLEntityConverter.java
M src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java
M src/org/openbravo/service/db/ClientImportEntityResolver.java
M src/org/openbravo/service/db/DataImportService.java
---
(0059507)
hgbot   
2013-06-18 20:13   
Repository: erp/devel/pi
Changeset: 83447d2c67e21ac06ca92c1d2ec432d5e9e2656a
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 18 20:12:58 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/83447d2c67e21ac06ca92c1d2ec432d5e9e2656a [^]

Fixes issue 23990: Fix reapplied, it did not break the tests

The changeset [1] had been backed out because apparently it had broken the automated tests. The tests were broken by other changeset (already fixed), so it can be applied again.

[1] https://code.openbravo.com/erp/devel/pi/rev/0047a4f2ebbac184b429674b2057645cfc1be0f0 [^]

---
M src/org/openbravo/dal/xml/BaseXMLEntityConverter.java
M src/org/openbravo/dal/xml/EntityResolver.java
M src/org/openbravo/dal/xml/XMLEntityConverter.java
M src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java
M src/org/openbravo/service/db/ClientImportEntityResolver.java
M src/org/openbravo/service/db/DataImportService.java
---
(0059517)
shankarb   
2013-06-19 10:15   
Code reviewed and tested in pi changeset b631ef452dae.
(0059558)
hudsonbot   
2013-06-20 02:07   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/5caf871044ad [^]

Maturity status: Test
(0059559)
hudsonbot   
2013-06-20 02:07   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/5caf871044ad [^]

Maturity status: Test
(0059565)
hudsonbot   
2013-06-20 02:08   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/5caf871044ad [^]

Maturity status: Test
(0059570)
hudsonbot   
2013-06-20 02:08   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/5caf871044ad [^]

Maturity status: Test
(0059588)
hudsonbot   
2013-06-20 02:08   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/5caf871044ad [^]

Maturity status: Test
(0059820)
hgbot   
2013-07-02 18:29   
Repository: erp/devel/pi
Changeset: 7c9b6e8a8f8574a242561aa4286ba16c642b423f
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jul 02 18:27:52 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7c9b6e8a8f8574a242561aa4286ba16c642b423f [^]

Fixes issue 24231: It is possible to apply a dataset in two organizations

In the fix of the issue 23990 [1] a new parameter was added to the resolve method of the EntityResolver class, that had to be set to true when it was called when datasets are being applied. This code was included in the process called when an organization is created with datasets, but not in the Enterprise Module Management process.

[1] https://code.openbravo.com/erp/devel/pi/rev/83447d2c67e21ac06ca92c1d2ec432d5e9e2656a [^]

---
M src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java
---
(0060012)
hudsonbot   
2013-07-16 14:26   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9a5d5983399f [^]

Maturity status: Test