[ 
https://issues.apache.org/jira/browse/OFBIZ-12735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17675948#comment-17675948
 ] 

ASF subversion and git services commented on OFBIZ-12735:
---------------------------------------------------------

Commit 5f11ebad2d097d49d972b4a02bfa33380e6fb951 in ofbiz-framework's branch 
refs/heads/trunk from Jacques Le Roux
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=5f11ebad2d ]

Fixed: Accounting Invoice Overview - PDF failed (OFBIZ-12735)

>hen clicking “PDF” button in the invoice view, it failed with a StackOverflow

A quick fix in DocTypeTemplate.groovy:
in def getCustomScreenTemplate()
Change:
parentTypeValue = from(entityTypeName).where().cache().queryFirst().parentTypeId
To:
String parentTypeValue =
from(entityTypeName)
.where("invoiceTypeId", fieldTypeValue)
.cache()
.queryFirst()
.parentTypeId

jleroux: I noticed this Ingo's not applied patch at OFBIZ-10215:
https://issues.apache.org/jira/secure/attachment/13045313/DocTypeTemplate-1.patch
It's very similar to Yannong's but a bit more general. We don't need to worry
about the 3 types (invoice, order, quote). It's already handled.

I also formatted getCustomScreenTemplate()

Thanks: Yannong Huang for report a proposition fic


> Accounting Invoice Overview - PDF failed
> ----------------------------------------
>
>                 Key: OFBIZ-12735
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12735
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>    Affects Versions: 22.01.01
>         Environment: jdk 11.07
> macOS
>            Reporter: yannong huang
>            Assignee: Jacques Le Roux
>            Priority: Major
>         Attachments: OFBIZ-12735.patch, Screenshot 2023-01-08 at 10.31.30 
> AM.png, stacktrace.rtf
>
>
> When clicking “PDF” button in the invoice view, it failed with 
> “java.lang.StackOverflowError” (see stack trace below).
> A quick fix:  
> in def getCustomScreenTemplate(String entityTypeName, String fieldTypeValue), 
> template/DocTypeTemplate.groovy,  
> Change: 
> parentTypeValue = 
> from(entityTypeName).where().cache().queryFirst().parentTypeId 
> To: 
> String parentTypeValue = from(entityTypeName).where("invoiceTypeId", 
> fieldTypeValue).cache().queryFirst().parentTypeId



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to