[
https://issues.apache.org/jira/browse/OFBIZ-9117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15666503#comment-15666503 ]
Jacques Le Roux edited comment on OFBIZ-9117 at 11/15/16 9:47 AM:
------------------------------------------------------------------
Here is the problematic code in EntityAutoEngine.java line 285,
{code}
if (! "fromDate".equals(pkFieldName)) {
String pkValue = dctx.getDelegator().getNextSeqId(modelEntity.getEntityName());
newEntity.set(pkFieldName, pkValue);
}
{code}
In createInvoiceContactMech service only contactMechId is out parameter, but pk fields size is three for InvoiceContactMech entity.
was (Author: deepak.dixit):
Here is the problematic code in EntityAutoEngine.java line 285,
{quote}
if (! "fromDate".equals(pkFieldName)) {
String pkValue = dctx.getDelegator().getNextSeqId(modelEntity.getEntityName());
newEntity.set(pkFieldName, pkValue);
}
{quote}
In createInvoiceContactMech service only contactMechId is out parameter, but pk fields size is three for InvoiceContactMech entity.
> EntityAuto engine override the passed service in parameters
> -----------------------------------------------------------
>
> Key: OFBIZ-9117
> URL:
https://issues.apache.org/jira/browse/OFBIZ-9117> Project: OFBiz
> Issue Type: Bug
> Components: ALL COMPONENTS
> Affects Versions: Trunk
> Reporter: Deepak Dixit
> Attachments: errorlog.txt
>
>
> There is an bug in EntityAuto engine, it override the passed service in parameters.
> In createInvoiceForOrder service calls the createInvoiceContactMech to crate invoice contactMech for PAYMENT_LOCATION purpose (at line no 357). In case of SO it should use Company PAYMENT_LOCATION contactMech. It get the Company contactMechId correctly and set it createInvoiceContactMech service in context correctly, but system throws foreign key constraints error for incorrect contactMechId.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)