Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0013281 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | major | have not tried | 2010-05-11 06:49 | 2010-05-18 21:44 | |||
Reporter | mtaal | View Status | public | |||||
Assigned To | mtaal | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | b27cb4c80a74 | ||||
Projection | none | ETA | none | Target Version | 2.50MP17 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | pi | SCM revision | ||||||
Merge Request Status | ||||||||
Review Assigned To | ||||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0013281: [REST] when inserting an object through REST allow setting the organization through xml | |||||||
Description | When a new object is passed in through a POST REST request the client/org are always set to the current client/org of the user. This eventhough the xml may contain a valid organization (for the current client of the user and accessible for the user). For example, for sales orders a user can choose the organization in the sales order entry. The same should be allowed through REST. | |||||||
Steps To Reproduce | 1) set the default role to Openbravo Admin but with organization 0 (*) 2) upload through REST (and a POST request) the attached order xml 3) you will get an error: <ob:error xmlns:ob="http://www.openbravo.com"><message>org.openbravo.service.web.InvalidContentException: [^] Object Order(null) is new but not writable Caused by: Object Order(null) is new but not writable</message></ob:error> | |||||||
Proposed Solution | Allow setting the organization through REST if it is a valid/writable organization for the user. Changes: see the XMLEntityConverter: 1) this has to be moved to after setting all many-to-one properties: if (!writable && bob.isNewOBObject()) { error("Object " + entityName + "(" + id + ") is new but not writable"); return bob; } 2) This has to be changed to check if the org is a valid/writable org for the user: final boolean orgUpdate = bob instanceof OrganizationEnabled && p.getName().equals(Client.PROPERTY_ORGANIZATION); if (!isOptionClientImport() && currentValue != null && (clientUpdate || orgUpdate)) { | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() | |||||||
![]() |
||||||||
|
![]() |
|
(0027133) hgbot (developer) 2010-05-11 13:24 |
Repository: erp/devel/pi Changeset: b27cb4c80a74ce23b5d861cfc32f1313fefa2c7d Author: Martin Taal <martin.taal <at> openbravo.com> Date: Tue May 11 13:23:41 2010 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/b27cb4c80a74ce23b5d861cfc32f1313fefa2c7d [^] Fixes issue 13281: [REST] when inserting an object through REST allow setting the organization through xml Fixes issue 13283: [REST] use organization of the object to retrieved referenced objects --- M src-test/org/openbravo/test/dal/IssuesTest.java M src/org/openbravo/dal/xml/XMLEntityConverter.java A src-test/org/openbravo/test/dal/test_13281.xml --- |
(0027322) iperdomo (viewer) 2010-05-14 19:02 |
Tested on PI @ rev. d58960feb659 |
(0027512) hudsonbot (viewer) 2010-05-18 21:44 |
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/b27cb4c80a74 [^] Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/aa11838d5f80 [^] Tests: http://builds.openbravo.com/view/devel-int/ [^] OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17380.obx [^] |
![]() |
|||
Date Modified | Username | Field | Change |
2010-05-11 06:49 | mtaal | New Issue | |
2010-05-11 06:49 | mtaal | Assigned To | => mtaal |
2010-05-11 06:49 | mtaal | File Added: rest_order.xml | |
2010-05-11 06:49 | mtaal | OBNetwork customer | => No |
2010-05-11 07:47 | mtaal | Relationship added | related to 0013283 |
2010-05-11 13:24 | hgbot | Checkin | |
2010-05-11 13:24 | hgbot | Note Added: 0027133 | |
2010-05-11 13:24 | hgbot | Status | new => resolved |
2010-05-11 13:24 | hgbot | Resolution | open => fixed |
2010-05-11 13:24 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/b27cb4c80a74ce23b5d861cfc32f1313fefa2c7d [^] |
2010-05-11 18:19 | jpabloae | Target Version | 2.50MP16 => 2.50MP17 |
2010-05-14 19:02 | iperdomo | Note Added: 0027322 | |
2010-05-14 19:02 | iperdomo | Status | resolved => closed |
2010-05-15 00:01 | anonymous | sf_bug_id | 0 => 3001864 |
2010-05-18 21:44 | hudsonbot | Checkin | |
2010-05-18 21:44 | hudsonbot | Note Added: 0027512 |
Copyright © 2000 - 2009 MantisBT Group |