Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023801Openbravo ERPA. Platformpublic2013-05-13 10:342013-05-23 01:33
caristu 
AugustoMauch 
immediatemajorhave not tried
closedfixed 
5
 
3.0MP24 
shankarb
Core
Production - Confirmed Stable
2013-01-08
https://code.openbravo.com/erp/devel/pi/rev/8525372a1fce7047ee3baead23e1ddfc208b6dd9 [^]
No
0023801: XML REST Webservices identifier property is not working
Is not possible to create new entities trough web services if we try to insert several entities in the same web service call.

To achieve this, the identifier property is used to refer another entity inside the very same web service call definition, (for example an invoice header and a line of the same invoice)
1) Use poster plugin to make a call to the AttributeSetInstance web service (for example, http://localhost:8080/openbravo/ws/dal/AttributeSetInstance [^]) using the attached xml definition.
No tags attached.
related to defect 0022738 closed dmiguelez Organization level datasets applied to different organizations 
related to defect 00217163.0MP16 closed AugustoMauch REST Webservice PUT Method not find objects for * 
related to defect 0023990 closed AugustoMauch Permission error when applying datasets 
xml xmlDefiniton.xml (2,131) 2013-05-13 10:34
https://issues.openbravo.com/file_download.php?file_id=6129&type=bug
Issue History
2013-05-13 10:34caristuNew Issue
2013-05-13 10:34caristuAssigned To => AugustoMauch
2013-05-13 10:34caristuFile Added: xmlDefiniton.xml
2013-05-13 10:34caristuModules => Core
2013-05-13 10:34caristuTriggers an Emergency Pack => No
2013-05-13 10:34caristuIssue Monitored: networkb
2013-05-13 10:36caristuRegression level => Production - Confirmed Stable
2013-05-13 10:36caristuRegression date => 2013-01-08
2013-05-13 10:36caristuRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/8525372a1fce7047ee3baead23e1ddfc208b6dd9 [^]
2013-05-13 15:52AugustoMauchRelationship addedrelated to 0022738
2013-05-13 15:53AugustoMauchRelationship addedrelated to 0021716
2013-05-14 16:54AugustoMauchIssue Monitored: shankarb
2013-05-14 16:55AugustoMauchReview Assigned To => shankarb
2013-05-14 16:57hgbotCheckin
2013-05-14 16:57hgbotNote Added: 0058642
2013-05-14 16:57hgbotCheckin
2013-05-14 16:57hgbotNote Added: 0058643
2013-05-14 16:57hgbotStatusnew => resolved
2013-05-14 16:57hgbotResolutionopen => fixed
2013-05-14 16:57hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d41072c387c44632a7ec7a48d3662a663a4555a5 [^]
2013-05-14 17:11AugustoMauchNote Added: 0058644
2013-05-14 17:13AugustoMauchNote Added: 0058645
2013-05-14 17:13AugustoMauchStatusresolved => new
2013-05-14 17:13AugustoMauchResolutionfixed => open
2013-05-14 17:13AugustoMauchNote Edited: 0058644bug_revision_view_page.php?bugnote_id=0058644#r4717
2013-05-14 17:13AugustoMauchStatusnew => scheduled
2013-05-14 17:13AugustoMauchfix_in_branch => pi
2013-05-14 17:13AugustoMauchStatusscheduled => resolved
2013-05-14 17:13AugustoMauchResolutionopen => fixed
2013-05-14 18:16hgbotCheckin
2013-05-14 18:16hgbotNote Added: 0058646
2013-05-15 09:44shankarbNote Added: 0058652
2013-05-15 09:44shankarbStatusresolved => closed
2013-05-15 09:44shankarbFixed in Version => 3.0MP24
2013-05-23 01:33hudsonbotCheckin
2013-05-23 01:33hudsonbotNote Added: 0058813
2013-05-23 01:33hudsonbotCheckin
2013-05-23 01:33hudsonbotNote Added: 0058814
2013-05-23 01:33hudsonbotCheckin
2013-05-23 01:33hudsonbotNote Added: 0058815
2013-06-10 11:50AugustoMauchRelationship addedrelated to 0023990

Notes
(0058642)
hgbot   
2013-05-14 16:57   
Repository: erp/devel/pi
Changeset: a5e71dc5836451a60450cadf3d972e9bcb30e859
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue May 14 10:58:14 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a5e71dc5836451a60450cadf3d972e9bcb30e859 [^]

Related to issue 23801: Restore previous resolving mode after DALWebService

The original resolving mode of the EntityResolver is ResolvingMode.ALLOW_NOT_EXIST. The DalWebService changes it to ResolvingMode.MUST_EXIST if the change action is ChangeAction.UPDATE, but it never reverts it to its previous mode.

---
M src/org/openbravo/dal/xml/EntityResolver.java
M src/org/openbravo/service/rest/DalWebService.java
---
(0058643)
hgbot   
2013-05-14 16:57   
Repository: erp/devel/pi
Changeset: d41072c387c44632a7ec7a48d3662a663a4555a5
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue May 14 16:54:34 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d41072c387c44632a7ec7a48d3662a663a4555a5 [^]

Fixes issue 23801:Inserting several entities in one web service call works

It was not possible to insert in a same web service call an entity and one child. To support this, the classes DalWebService and EntityResolver have been modified. The approach using the lookForTranslatedIDs [1] has been reverted. Now, the EntityResolver.resolve method first tries to resolve the entity as it used to do it before the regression was introduced, and if it does not find the entity then it tries to fetch it using an OBCriteria without applying the organization filter, so that this issue [2] is not reproduced.

A new function has been created to search for the entity. It accepts a boolean that will be used to specify if the organization filter should be applied. The old doSearch method calls the new method passing true to this flag, so it keeps working as usual.

[1] https://code.openbravo.com/erp/devel/pi/rev/8525372a1fce7047ee3baead23e1ddfc208b6dd9 [^]
[2] https://issues.openbravo.com/view.php?id=21716 [^]

---
M src/org/openbravo/dal/xml/EntityResolver.java
M src/org/openbravo/service/rest/DalWebService.java
---
(0058644)
AugustoMauch   
2013-05-14 17:11   
(edited on: 2013-05-14 17:13)
Test plan:
First, install the Firefox Poster add on.

Check that the issue https://issues.openbravo.com/view.php?id=19974 [^] keeps working. For that:
- Open Openbravo and set '*' as the default organization.
- Open the Firefox Poster and enter this data:
URL: http://localhost:8080/openbravo/ws/dal/BusinessPartner [^]
User Auth: your login and password
Content:

<?xml version="1.0" encoding="UTF-8"?>
<ob:Openbravo xmlns:ob="http://www.openbravo.com"> [^] [^]
<BusinessPartner id="A6750F0D15334FB890C254369AC750A8">
  <name>Alimentos y Supermercados, S.A Nuevo Nombre</name>
</BusinessPartner>
</ob:Openbravo>

Press the PUSH button. The business partner should be updated.

(0058645)
AugustoMauch   
2013-05-14 17:13   
Test plan (cont):

- Open the Firefox Poster
URL: http://localhost:8080/openbravo/ws/dal/BusinessPartner [^] [^]
User Auth: your login and password
Content:

<ob:Openbravo xmlns:ob="http://www.openbravo.com" [^] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> [^]
    <BusinessPartnerCategory id="B9EB1CD0981B49AAB43AE75D3F0420AM" identifier="aaa">
        <id>B9EB1CD0981B49AAB43AE75D3F0420AM</id>
        <client id="23C59575B9CF467C9620760EB255B389" entity-name="ADClient" identifier="AA" />
        <organization id="E443A31992CB4635AFCAEABE7183CE85" entity-name="Organization" identifier="BB" />
        <active>true</active>
        <creationDate transient="true">2013-05-09T12:53:56.521Z</creationDate>
        <createdBy transient="true" id="100" entity-name="ADUser" identifier="Openbravo" />
        <updated transient="true">2013-05-09T12:53:56.521Z</updated>
        <updatedBy transient="true" id="100" entity-name="ADUser" identifier="Openbravo" />
                <searchKey>TC4</searchKey>
                <name>Test Category4</name>
    </BusinessPartnerCategory>

<BusinessPartner id="A6750F0D15334FB890C254369AC750A9">
        <id>A6750F0D15334FB890C254369AC750A9</id>
        <client id="23C59575B9CF467C9620760EB255B389" entity-name="ADClient" identifier="AA" />
        <organization id="E443A31992CB4635AFCAEABE7183CE85" entity-name="Organization" identifier="BB" />
        <active>true</active>
        <creationDate transient="true">2013-05-09T12:53:56.521Z</creationDate>
        <createdBy transient="true" id="100" entity-name="ADUser" identifier="Openbravo" />
        <updated transient="true">2013-05-09T12:53:56.521Z</updated>
        <updatedBy transient="true" id="100" entity-name="ADUser" identifier="Openbravo" />
                <searchKey>TCB4</searchKey>
                <name>Test BP4</name>
                <businessPartnerCategory id="B9EB1CD0981B49AAB43AE75D3F0420AM" entity-name="BusinessPartnerCategory" identifier="aaa"/>
</BusinessPartner>
</ob:Openbravo>

Press the POST button. The business partner category and the business partner should be added.
(0058646)
hgbot   
2013-05-14 18:16   
Repository: erp/devel/pi
Changeset: 8444cd29ae958dad86b9575e1ae6f7548fbf7a04
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue May 14 18:15:58 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/8444cd29ae958dad86b9575e1ae6f7548fbf7a04 [^]

Related to bug 23801: Deprecates setLookForTranslatedIDs so API is not broken

---
M src/org/openbravo/dal/xml/EntityResolver.java
---
(0058652)
shankarb   
2013-05-15 09:44   
Code reviewed and verified in pi changeset be142dce89dd.
(0058813)
hudsonbot   
2013-05-23 01:33   
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/97c7f6256af7 [^]

Maturity status: Test
(0058814)
hudsonbot   
2013-05-23 01:33   
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/97c7f6256af7 [^]

Maturity status: Test
(0058815)
hudsonbot   
2013-05-23 01:33   
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/97c7f6256af7 [^]

Maturity status: Test