[
https://issues.apache.org/jira/browse/OFBIZ-9117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15672583#comment-15672583 ]
Paul Foxworthy commented on OFBIZ-9117:
---------------------------------------
Hi Deepak and Jacques,
I think the problem is in the definition of the createInvoiceContactMech Service:
<service name="createInvoiceContactMech" engine="entity-auto" invoke="create" default-entity-name="InvoiceContactMech">
<description>Create a ContactMech for an invoice</description>
<permission-service service-name="acctgInvoicePermissionCheck" main-action="CREATE"/>
<auto-attributes include="pk" mode="IN" optional="false"/>
<attribute name="contactMechId" type="String" mode="OUT" optional="true"/>
</service>
Why the "OUT" on the contactMechId? The service should *not* be generating a new contactMechId, it's an input to associate an existing ContactMech with the invoice.
If we delete the line <attribute name="contactMechId" type="String" mode="OUT" optional="true"/>, will everything then work? I think so.
> 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)