You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by "jeff.koo@krystal.institute" <je...@krystal.institute> on 2022/12/14 03:45:06 UTC

Error while creating purchase order

Hello Community, 

I was creating a "Purchase Order".  On the page 'Purchase Order : Order Confirmation' and clicked on the button 'Create Order'. The following error occurred. 
I would like to know what I missed for the input. 
Regards, 
Jeff 

I got the following error: 

Did not complete the order, the following occurred:ERROR : Could not create order 
(write error :org.apache.ofbiz.entity.GenericEntityException: org.apache.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:OrderItemShipGroup][carrierPartyId,_NA_(java.lang.String)][carrierRoleTypeId,CARRIER(java.lang.String)][contactMechId,10060(java.lang.String)][createdStamp,2022-12-14 11:32:34.763(java.sql.Timestamp)][createdTxStamp,2022-12-14 11:32:34.667(java.sql.Timestamp)][estimatedDeliveryDate,2022-12-16 00:00:00.0(java.sql.Timestamp)][facilityId,10001(java.lang.String)][giftMessage,null()][isGift,N(java.lang.String)][lastUpdatedStamp,2022-12-14 11:32:34.763(java.sql.Timestamp)][lastUpdatedTxStamp,2022-12-14 11:32:34.667(java.sql.Timestamp)][maySplit,N(java.lang.String)][orderId,101(java.lang.String)][shipAfterDate,null()][shipByDate,null()][shipGroupSeqId,00001(java.lang.String)][shipmentMethodTypeId,STANDARD(java.lang.String)]
[shippingInstructions,null()][supplierAgreementId,null()][supplierPartyId,null()][telecomContactMechId,null()][vendorPartyId,null()] (SQL Exception while executing the following:INSERT INTO OFBIZ.ORDER_ITEM_SHIP_GROUP 
(ORDER_ID, SHIP_GROUP_SEQ_ID, SHIPMENT_METHOD_TYPE_ID, SUPPLIER_PARTY_ID, SUPPLIER_AGREEMENT_ID, VENDOR_PARTY_ID, CARRIER_PARTY_ID, CARRIER_ROLE_TYPE_ID, FACILITY_ID, CONTACT_MECH_ID, TELECOM_CONTACT_MECH_ID, TRACKING_NUMBER, SHIPPING_INSTRUCTIONS, 
MAY_SPLIT, GIFT_MESSAGE, IS_GIFT, SHIP_AFTER_DATE, SHIP_BY_DATE, ESTIMATED_SHIP_DATE, ESTIMATED_DELIVERY_DATE, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (INSERT on table 'ORDER_ITEM_SHIP_GROUP' caused a violation of foreign key constraint 'ORDER_ITSG_CSHM'for key (STANDARD,_NA_,CARRIER). The statement has been rolled back.))

Re: Error while creating purchase order

Posted by Daniel Watford <da...@foomoo.co.uk>.
Hi Jeff,

This issue looks like it matches
https://issues.apache.org/jira/browse/OFBIZ-12608 and is due to some
missing seed data.

The missing data is included in the full demo dataset which is loaded into
OFBiz during setup with the following command:

./gradlew loadAll

This error is caused by a missing Shipment Method Type. In the demo
instance, you can view Shipment Method Types here: OFBiz: Catalog Manager:
List Shipment Method Types (apache.org)
<https://demo-next.ofbiz.apache.org/catalog/control/ListShipmentMethodTypes>

There also needs to be a Party configured with ID, '_NA_' and assigned the
role, CARRIER.

The missing entities were recently moved to seed data as part of fixing
OFBIZ-12608.

You can view the missing entities in this file:
https://github.com/apache/ofbiz-framework/blob/trunk/applications/order/data/PurchaseOrderShippingSeedData.xml.
You can use the WebTool to import that file as a fix for your environment.

HTH

Dan.

On Wed, 14 Dec 2022 at 03:45, jeff.koo@krystal.institute
<je...@krystal.institute> wrote:

> Hello Community,
>
> I was creating a "Purchase Order".  On the page 'Purchase Order : Order
> Confirmation' and clicked on the button 'Create Order'. The following error
> occurred.
> I would like to know what I missed for the input.
> Regards,
> Jeff
>
> I got the following error:
>
> Did not complete the order, the following occurred:ERROR : Could not
> create order
> (write error :org.apache.ofbiz.entity.GenericEntityException:
> org.apache.ofbiz.entity.GenericEntityException: Error while inserting:
> [GenericEntity:OrderItemShipGroup][carrierPartyId,_NA_(java.lang.String)][carrierRoleTypeId,CARRIER(java.lang.String)][contactMechId,10060(java.lang.String)][createdStamp,2022-12-14
> 11:32:34.763(java.sql.Timestamp)][createdTxStamp,2022-12-14
> 11:32:34.667(java.sql.Timestamp)][estimatedDeliveryDate,2022-12-16
> 00:00:00.0(java.sql.Timestamp)][facilityId,10001(java.lang.String)][giftMessage,null()][isGift,N(java.lang.String)][lastUpdatedStamp,2022-12-14
> 11:32:34.763(java.sql.Timestamp)][lastUpdatedTxStamp,2022-12-14
> 11:32:34.667(java.sql.Timestamp)][maySplit,N(java.lang.String)][orderId,101(java.lang.String)][shipAfterDate,null()][shipByDate,null()][shipGroupSeqId,00001(java.lang.String)][shipmentMethodTypeId,STANDARD(java.lang.String)]
> [shippingInstructions,null()][supplierAgreementId,null()][supplierPartyId,null()][telecomContactMechId,null()][vendorPartyId,null()]
> (SQL Exception while executing the following:INSERT INTO
> OFBIZ.ORDER_ITEM_SHIP_GROUP
> (ORDER_ID, SHIP_GROUP_SEQ_ID, SHIPMENT_METHOD_TYPE_ID, SUPPLIER_PARTY_ID,
> SUPPLIER_AGREEMENT_ID, VENDOR_PARTY_ID, CARRIER_PARTY_ID,
> CARRIER_ROLE_TYPE_ID, FACILITY_ID, CONTACT_MECH_ID,
> TELECOM_CONTACT_MECH_ID, TRACKING_NUMBER, SHIPPING_INSTRUCTIONS,
> MAY_SPLIT, GIFT_MESSAGE, IS_GIFT, SHIP_AFTER_DATE, SHIP_BY_DATE,
> ESTIMATED_SHIP_DATE, ESTIMATED_DELIVERY_DATE, LAST_UPDATED_STAMP,
> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (INSERT on
> table 'ORDER_ITEM_SHIP_GROUP' caused a violation of foreign key constraint
> 'ORDER_ITSG_CSHM'for key (STANDARD,_NA_,CARRIER). The statement has been
> rolled back.))
>


-- 
Daniel Watford