You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2022/06/17 12:02:50 UTC

[ofbiz-framework] branch trunk updated: Fixed: Service getNextOrderId failed if a customMethod is present (OFBIZ-12651)

This is an automated email from the ASF dual-hosted git repository.

nmalin pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 59617b38ac Fixed: Service getNextOrderId failed if a customMethod is present (OFBIZ-12651)
59617b38ac is described below

commit 59617b38ac5f8956bb0142e629a52b263ec9b424
Author: Nicolas Malin <ni...@nereide.fr>
AuthorDate: Fri Jun 17 13:45:03 2022 +0200

    Fixed: Service getNextOrderId failed if a customMethod is present (OFBIZ-12651)
    
    When you generate an order on a party who have a PartyAcctgPreference with a customMethod orderSequence_enforced, the service failed due to the missing parameter partyAcctgPreference.
    
    Like quote and invoice it's preferable to forward the partyAcctgPreference information.
---
 applications/order/groovyScripts/order/OrderServices.groovy | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/applications/order/groovyScripts/order/OrderServices.groovy b/applications/order/groovyScripts/order/OrderServices.groovy
index f9d043b5dc..a9975ab1cf 100644
--- a/applications/order/groovyScripts/order/OrderServices.groovy
+++ b/applications/order/groovyScripts/order/OrderServices.groovy
@@ -47,9 +47,10 @@ def getNextOrderId() {
         customMethodName = 'orderSequence_enforced'
     }
 
+    String orderIdTemp
     if (customMethodName) {
-        Map customMethodMap = [*: parameters]
-        Map result = run service: customMethodName, with: customMethodMap
+        parameters.partyAcctgPreference = partyAcctgPreference
+        Map result = run service: customMethodName, with: parameters
         orderIdTemp = result.orderId
     } else {
         logInfo 'In getNextOrderId sequence by Standard'
@@ -68,10 +69,7 @@ def getNextOrderId() {
     if (partyAcctgPreference) orderId += partyAcctgPreference.orderIdPrefix ?: ""
     orderId += orderIdTemp.toString()
 
-    Map result = success()
-    result.orderId = orderId
-
-    return result
+    return success([orderId: orderId])
 }
 
 /**