Fixed: Create return is not working on demo trunk
Some parties have no PartyAccountingPreferences
Thanks: Yashwant Dhakad for report (see "Steps to reproduce" in Jira)
@@ -95,12 +95,16 @@ def createReturnHeader() {
userLogin: systemLogin]
GenericValue partyAcctgPreference = serviceResult.partyAccountingPreference
+ if (partyAcctgPreference) {
if ("Y" == partyAcctgPreference.useInvoiceIdForReturns) {
Map serviceResultInvoice = run service: "getNextInvoiceId", with: [partyId: parameters.toPartyId]
newEntity.returnId = serviceResultInvoice.invoiceId
} else {
newEntity.returnId = delegator.getNextSeqId("ReturnHeader")
}
+ } else {
+ newEntity.returnId = delegator.getNextSeqId("ReturnHeader")
+ }
result.returnId = newEntity.returnId
boolean hasCreatePermission = security.hasEntityPermission("ORDERMGR", "_CREATE", parameters.userLogin)
