Author: jleroux
Date: Sat Sep 10 13:54:58 2011
New Revision: 1167517
URL: http://svn.apache.org/viewvc?rev=1167517&view=rev
Log:
A patch from Paul Foxworthy "createItemIssuanceRole and deleteItemIssuanceRole
require Shipment PK parameter" https://issues.apache.org/jira/browse/OFBIZ-4344
createItemIssuanceRole and deleteItemIssuanceRole both call
checkCanChangeShipmentStatusPacked, which checks the current status of a
shipment to see if anything about it can be modified.
Therefore, these services require a shipmentId parameter, but at present their
service definitions don't say so.
At high logging levels, this bug causes log entries to say there's a missing PK
value on a FindOne.
This is not a major problem at present. create... is only called in the midst
of another service and the test has already been done, but a direct call to
create... might cause incorrect behaviour. delete... is not called within Ofbiz
at present.
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
ofbiz/trunk/applications/product/servicedef/services_shipment.xml
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml?rev=1167517&r1=1167516&r2=1167517&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
(original)
+++
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
Sat Sep 10 13:54:58 2011
@@ -211,6 +211,7 @@ under the License.
<!--<call-simple-method method-name="findCreateIssueShipmentItem"/>-->
<set field="eventDate" from-field="parameters.eventDate"/>
+ <set field="shipmentId" from-field="parameters.shipmentId"/>
<call-simple-method method-name="findCreateItemIssuance"/>
<call-simple-method method-name="associateIssueRoles"/>
@@ -368,6 +369,7 @@ under the License.
<set from-field="itemIssuanceId"
field="itemIssuanceRoleCreate.itemIssuanceId"/>
<set from-field="userLogin.partyId"
field="itemIssuanceRoleCreate.partyId"/>
<set value="PACKER" field="itemIssuanceRoleCreate.roleTypeId"/>
+ <set from-field="shipmentId"
field="itemIssuanceRoleCreate.shipmentId"/>
<call-service service-name="createItemIssuanceRole"
in-map-name="itemIssuanceRoleCreate"/>
</if-empty>
</simple-method>
Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=1167517&r1=1167516&r2=1167517&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Sat Sep
10 13:54:58 2011
@@ -418,12 +418,16 @@ under the License.
<description>Create ItemIssuanceRole</description>
<permission-service service-name="facilityGenericPermission"
main-action="CREATE"/>
<auto-attributes include="pk" mode="IN" optional="false"/>
+ <!-- Will check if OK to change status of shipment, so Shipment PK is
needed -->
+ <auto-attributes entity-name="Shipment" include="pk" mode="IN"
optional="false"/>
</service>
<service name="deleteItemIssuanceRole"
default-entity-name="ItemIssuanceRole" engine="simple"
location="component://product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml"
invoke="deleteItemIssuanceRole" auth="true">
<description>Delete ItemIssuanceRole</description>
<permission-service service-name="facilityGenericPermission"
main-action="DELETE"/>
<auto-attributes include="pk" mode="IN" optional="false"/>
+ <!-- Will check if OK to change status of shipment, so Shipment PK is
needed -->
+ <auto-attributes entity-name="Shipment" include="pk" mode="IN"
optional="false"/>
</service>
<service name="issueOrderItemToShipment" engine="simple"