Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021716Openbravo ERPA. Platformpublic2012-09-21 12:592012-09-30 22:03
caristu 
AugustoMauch 
urgentmajoralways
closedfixed 
5
 
3.0MP163.0MP17 
mtaal
Core
No
0021716: REST Webservice PUT Method not find objects for *
When trying to perform an update via REST web services, if the default organization is '*' the update not works because can't find the object id.

It should work because in the application it is possible to change, for example, the business partner name, with * as default organization.
1) Log in with * as default organizaion
2) Perform the following update, that updates the business partner "Alimentos y Supermercados" name:

<?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>

3) We obtain the following error:
<ob:error xmlns:ob="http://www.openbravo.com"><message>org.openbravo.service.web.InvalidContentException: [^] Exception when parsing entity BusinessPartner (A6750F0D15334FB890C254369AC750A8):Entity BusinessPartner with id A6750F0D15334FB890C254369AC750A8 not found
Caused by: Exception when parsing entity BusinessPartner (A6750F0D15334FB890C254369AC750A8):Entity BusinessPartner with id A6750F0D15334FB890C254369AC750A8 not found</message></ob:error>
No tags attached.
has duplicate defect 00215293.0MP17 closed ioritzCia Updating default warehouse by using web services not working properly 
related to design defect 0021758 acknowledged AugustoMauch Update the ClientExportImportTest so it can be reactivated 
related to defect 0023801 closed AugustoMauch XML REST Webservices identifier property is not working 
related to defect 0023990 closed AugustoMauch Permission error when applying datasets 
Issue History
2012-09-21 12:59caristuNew Issue
2012-09-21 12:59caristuAssigned To => AugustoMauch
2012-09-21 12:59caristuModules => Core
2012-09-21 12:59caristuResolution time => 1351116000
2012-09-21 12:59caristuIssue Monitored: networkb
2012-09-24 16:02AugustoMauchNote Added: 0052346
2012-09-26 10:28AugustoMauchRelationship addedrelated to 0021758
2012-09-26 12:01AugustoMauchIssue Monitored: mtaal
2012-09-26 12:01AugustoMauchClosed by => mtaal
2012-09-26 12:02hgbotCheckin
2012-09-26 12:02hgbotNote Added: 0052618
2012-09-26 12:02hgbotStatusnew => resolved
2012-09-26 12:02hgbotResolutionopen => fixed
2012-09-26 12:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fd9a9c55609325f4b5b00b831cd812dce16f8ba9 [^]
2012-09-26 12:56hgbotCheckin
2012-09-26 12:56hgbotNote Added: 0052621
2012-09-26 12:57AugustoMauchNote Added: 0052622
2012-09-26 12:57AugustoMauchStatusresolved => new
2012-09-26 12:57AugustoMauchResolutionfixed => open
2012-09-27 09:48hgbotCheckin
2012-09-27 09:48hgbotNote Added: 0052823
2012-09-27 09:48hgbotStatusnew => resolved
2012-09-27 09:48hgbotResolutionopen => fixed
2012-09-27 09:48hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/fd9a9c55609325f4b5b00b831cd812dce16f8ba9 [^] => http://code.openbravo.com/erp/devel/pi/rev/9d212ece87cbc923b5ff28352139e9fa24e9b12f [^]
2012-09-28 13:06ioritzCiaRelationship addedhas duplicate 0021529
2012-09-28 14:39hudsonbotCheckin
2012-09-28 14:39hudsonbotNote Added: 0052908
2012-09-28 14:39hudsonbotCheckin
2012-09-28 14:39hudsonbotNote Added: 0052909
2012-09-28 14:39hudsonbotCheckin
2012-09-28 14:39hudsonbotNote Added: 0052918
2012-09-30 22:03mtaalNote Added: 0052940
2012-09-30 22:03mtaalStatusresolved => closed
2012-09-30 22:03mtaalFixed in Version => 3.0MP17
2013-05-13 15:53AugustoMauchRelationship addedrelated to 0023801
2013-06-10 11:49AugustoMauchRelationship addedrelated to 0023990

Notes
(0052346)
AugustoMauch   
2012-09-24 16:02   
This behaviour is caused by the implementacion of the getOrgIds method [1] of the EntityResolver class. If the current organization is 0, then it returns just '0', instead of the natural tree.

[1] https://code.openbravo.com/erp/devel/pi/file/57f229938edf/src/org/openbravo/dal/xml/EntityResolver.java#l534 [^]
(0052618)
hgbot   
2012-09-26 12:02   
Repository: erp/devel/pi
Changeset: fd9a9c55609325f4b5b00b831cd812dce16f8ba9
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Sep 26 10:47:44 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fd9a9c55609325f4b5b00b831cd812dce16f8ba9 [^]

Fixes issue 21716: REST Webservice works with organization '*'

The EntityResolver.getOrgIds has been modified, because prior to the fix if it was called with the organization '0', it returned '0' instead of the natural true. And now, if it is called for an organization other than EntityResolver.organization, it returns a recomputed natural true (orgNaturalTree is the natural the of EntityResolver.organization).

---
M src-test/org/openbravo/test/AllTests.java
M src/org/openbravo/dal/xml/EntityResolver.java
---
(0052621)
hgbot   
2012-09-26 12:56   
Repository: erp/devel/pi
Changeset: cce05b691662ac077cccd1276187b01ccf454fde
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Sep 26 12:55:20 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/cce05b691662ac077cccd1276187b01ccf454fde [^]

Related to issue 21716: Reverted fix because it breaks install.source

---
M src/org/openbravo/dal/xml/EntityResolver.java
---
(0052622)
AugustoMauch   
2012-09-26 12:57   
Reopened because the previous fix broke install.source
(0052823)
hgbot   
2012-09-27 09:48   
Repository: erp/devel/pi
Changeset: 9d212ece87cbc923b5ff28352139e9fa24e9b12f
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Sep 26 14:22:55 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9d212ece87cbc923b5ff28352139e9fa24e9b12f [^]

Fixes issue 21716: REST Webservices can update records from '*' organization

---
M src/org/openbravo/dal/xml/EntityResolver.java
---
(0052908)
hudsonbot   
2012-09-28 14:39   
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/6d2f8cffd4b1 [^]

Maturity status: Test
(0052909)
hudsonbot   
2012-09-28 14:39   
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/6d2f8cffd4b1 [^]

Maturity status: Test
(0052918)
hudsonbot   
2012-09-28 14:39   
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/6d2f8cffd4b1 [^]

Maturity status: Test
(0052940)
mtaal   
2012-09-30 22:03   
Reviewed