[
https://issues.apache.org/jira/browse/OFBIZ-11168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17254859#comment-17254859
]
ASF subversion and git services commented on OFBIZ-11168:
---------------------------------------------------------
Commit 3cdd1fcec74dc85f20455d449d809a1c482e4165 in ofbiz-framework's branch
refs/heads/trunk from Jacques Le Roux
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=3cdd1fc ]
Fixed: Issue in creating promotion action (OFBIZ-11168)
The issue reported there was fixed with OFBIZ-11058.
But there was still an issue in logI reported in a comment.
The problem was that
<#assign productPromoActionCurEnum =
productPromoAction.getRelatedOne("ActionEnumeration", true)>
was used in 2 places where it should not have been because it returned a null
value that can't be handled by OFBiz.
Better use
<#assign productPromoActionCustomMethod =
productPromoAction.getRelatedOne("CustomMethod", true)>
and
productPromoAction.getRelatedOne("ActionEnumeration", true))??
The repercussion was that the description was not used but the Id and the log
was showing an error.
> Issue in creating promotion action
> ----------------------------------
>
> Key: OFBIZ-11168
> URL: https://issues.apache.org/jira/browse/OFBIZ-11168
> Project: OFBiz
> Issue Type: Bug
> Components: product
> Affects Versions: Release Branch 18.12, Trunk
> Reporter: Lalit Dashora
> Assignee: Jacques Le Roux
> Priority: Major
> Fix For: 18.12.01, 17.12.05
>
> Attachments: customMethodID.png
>
>
> Steps to replicate:
> 1. Navigate to create promotion screen and create a promotion.
> 2. Add a promotion rule.
> 3. Add condition of cart sub-total greater than zero. Create condition.
> 4. In action select X product at Y price and also add the amount.
> 5. Click on create action button.
> 6. System is throwing error as below:
> The Following Errors Occurred:
> Error doing entity-auto operation for entity ProductPromoAction in service
> createProductPromoAction: org.apache.ofbiz.entity.GenericEntityException:
> org.apache.ofbiz.entity.GenericEntityException: Error while inserting:
> [GenericEntity:ProductPromoAction][amount,null()][createdStamp,2019-08-24
> 09:25:00.139(java.sql.Timestamp)][createdTxStamp,2019-08-24
> 09:25:00.086(java.sql.Timestamp)][customMethodId,[,
> PPA_PROD_AMDISC](java.lang.String)][lastUpdatedStamp,2019-08-24
> 09:25:00.139(java.sql.Timestamp)][lastUpdatedTxStamp,2019-08-24
> 09:25:00.086(java.sql.Timestamp)][orderAdjustmentTypeId,PROMOTION_ADJUSTMENT(java.lang.String)][partyId,null()][productId,null()][productPromoActionSeqId,10003(java.lang.String)][productPromoId,10000(java.lang.String)][productPromoRuleId,00001(java.lang.String)][quantity,500(java.math.BigDecimal)][serviceName,null()][useCartQuantity,N(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO
> OFBIZ.PRODUCT_PROMO_ACTION (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_ACTION_ENUM_ID, CUSTOM_METHOD_ID,
> ORDER_ADJUSTMENT_TYPE_ID, SERVICE_NAME, QUANTITY, AMOUNT, PRODUCT_ID,
> PARTY_ID, USE_CART_QUANTITY, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?, ?, ?) (INSERT on table 'PRODUCT_PROMO_ACTION' caused a violation of
> foreign key constraint 'PROD_PRACT_CMET' for key ([, PPA_PROD_AMDISC]). The
> statement has been rolled back.)) (Error while inserting:
> [GenericEntity:ProductPromoAction][amount,null()][createdStamp,2019-08-24
> 09:25:00.139(java.sql.Timestamp)][createdTxStamp,2019-08-24
> 09:25:00.086(java.sql.Timestamp)][customMethodId,[,
> PPA_PROD_AMDISC](java.lang.String)][lastUpdatedStamp,2019-08-24
> 09:25:00.139(java.sql.Timestamp)][lastUpdatedTxStamp,2019-08-24
> 09:25:00.086(java.sql.Timestamp)][orderAdjustmentTypeId,PROMOTION_ADJUSTMENT(java.lang.String)][partyId,null()][productId,null()][productPromoActionSeqId,10003(java.lang.String)][productPromoId,10000(java.lang.String)][productPromoRuleId,00001(java.lang.String)][quantity,500(java.math.BigDecimal)][serviceName,null()][useCartQuantity,N(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO
> OFBIZ.PRODUCT_PROMO_ACTION (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_ACTION_ENUM_ID, CUSTOM_METHOD_ID,
> ORDER_ADJUSTMENT_TYPE_ID, SERVICE_NAME, QUANTITY, AMOUNT, PRODUCT_ID,
> PARTY_ID, USE_CART_QUANTITY, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?, ?, ?) (INSERT on table 'PRODUCT_PROMO_ACTION' caused a violation of
> foreign key constraint 'PROD_PRACT_CMET' for key ([, PPA_PROD_AMDISC]). The
> statement has been rolled back.)))
--
This message was sent by Atlassian Jira
(v8.3.4#803005)