|
Author: jacopoc
Date: Mon Jan 11 15:19:03 2010 New Revision: 897897 URL: http://svn.apache.org/viewvc?rev=897897&view=rev Log: Implemented upgrade service for ItemIssuance->OrderShipment record migration for purchase shipments. Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/UpgradeServices.xml ofbiz/trunk/applications/order/servicedef/services_upgrade.xml Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/UpgradeServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/UpgradeServices.xml?rev=897897&r1=897896&r2=897897&view=diff ============================================================================== --- ofbiz/trunk/applications/order/script/org/ofbiz/order/UpgradeServices.xml (original) +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/UpgradeServices.xml Mon Jan 11 15:19:03 2010 @@ -48,5 +48,29 @@ <create-value value-field="custRequestParty"/> </iterate> </simple-method> -</simple-methods> + <simple-method method-name="migrateOrderShipment" short-description="Migrate data from OldOrderItemAssociation to OrderItemAssoc"> + <entity-condition entity-name="ItemIssuance" list="itemIssuances"> + <condition-list combine="and"> + <condition-expr field-name="inventoryItemId" operator="equals" from-field="nullField"/> + <condition-expr field-name="shipmentId" operator="not-equals" from-field="nullField"/> + <condition-expr field-name="shipmentItemSeqId" operator="not-equals" from-field="nullField"/> + </condition-list> + </entity-condition> + <iterate list="itemIssuances" entry="itemIssuance"> + <make-value entity-name="OrderShipment" value-field="orderShipment"/> + <set field="orderShipment.orderId" from-field="itemIssuance.orderId"/> + <set field="orderShipment.orderItemSeqId" from-field="itemIssuance.orderItemSeqId"/> + <set field="orderShipment.shipGroupSeqId" from-field="itemIssuance.shipGroupSeqId"/> + <set field="orderShipment.shipmentId" from-field="itemIssuance.shipmentId"/> + <set field="orderShipment.shipmentItemSeqId" from-field="itemIssuance.shipmentItemSeqId"/> + <set field="orderShipment.quantity" from-field="itemIssuance.quantity"/> + <create-value value-field="orderShipment"/> + <get-related value-field="itemIssuance" relation-name="ItemIssuanceRole" list="itemIssuanceRoles"/> + <iterate entry="itemIssuanceRole" list="itemIssuanceRoles"> + <remove-value value-field="itemIssuanceRole"/> + </iterate> + <remove-value value-field="itemIssuance"/> + </iterate> + </simple-method> +</simple-methods> Modified: ofbiz/trunk/applications/order/servicedef/services_upgrade.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_upgrade.xml?rev=897897&r1=897896&r2=897897&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services_upgrade.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services_upgrade.xml Mon Jan 11 15:19:03 2010 @@ -45,4 +45,12 @@ party/data/PartyTypeData.xml </description> </service> + <service name="migrateOrderShipment" engine="simple" + location="component://order/script/org/ofbiz/order/UpgradeServices.xml" invoke="migrateOrderShipment"> + <description> + Since revision 895250 (2010-01-02) the entity OrderShipment is used to record purchase order items that + will be received as part of a purchase shipment. Previously ItemIssuance was used with an empty inventoryId. + This service will replace ItemIssuaces with OrderShipment records for the required shipments. + </description> + </service> </services> |
| Free forum by Nabble | Edit this page |
