Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
| View Issue Details | ||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
| 0013281 | Openbravo ERP | A. Platform | public | 2010-05-11 06:49 | 2010-05-18 21:44 | |||||||
| Reporter | mtaal | |||||||||||
| Assigned To | mtaal | |||||||||||
| Priority | normal | Severity | major | Reproducibility | have not tried | |||||||
| Status | closed | Resolution | fixed | |||||||||
| Platform | OS | 5 | OS Version | |||||||||
| Product Version | pi | |||||||||||
| Target Version | 2.50MP17 | Fixed in Version | ||||||||||
| 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)) { | |||||||||||
| Additional Information | ||||||||||||
| Tags | No tags attached. | |||||||||||
| Relationships |
| |||||||||||
| Attached Files | https://issues.openbravo.com/file_download.php?file_id=2541&type=bug | |||||||||||
| Issue History | ||||||||||||
| 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 | ||||||||||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||