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 2ddde9f  Fixed: OrderId with null value on refresh init base 
(OFBIZ-12076)
2ddde9f is described below

commit 2ddde9fb6ba9ed81e2b80d60128015695afbd446
Author: Nicolas Malin <[email protected]>
AuthorDate: Mon Nov 30 09:48:41 2020 +0100

    Fixed: OrderId with null value on refresh init base
    (OFBIZ-12076)
    
    After a fresh data base init with only seed, if you create your company 
without order prefix, your orderId sequence will be generate with 'null' string 
where the order prefix should be have :
    
    > null10001, null10002, ...
    
    This come from the groovy migration of service 'getNextOrderId' where 
productStore.orderNumberPrefix is loaded on the sequence without control if is 
empty or not
---
 applications/order/groovyScripts/order/OrderServices.groovy | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/applications/order/groovyScripts/order/OrderServices.groovy 
b/applications/order/groovyScripts/order/OrderServices.groovy
index 8af3ad1..f9d043b 100644
--- a/applications/order/groovyScripts/order/OrderServices.groovy
+++ b/applications/order/groovyScripts/order/OrderServices.groovy
@@ -64,8 +64,8 @@ def getNextOrderId() {
 
     // use orderIdTemp along with the orderIdPrefix to create the real ID
     String orderId = ''
-    if (productStore) orderId += productStore.orderNumberPrefix
-    if (partyAcctgPreference) orderId += partyAcctgPreference.orderIdPrefix
+    if (productStore) orderId += productStore.orderNumberPrefix ?: ""
+    if (partyAcctgPreference) orderId += partyAcctgPreference.orderIdPrefix ?: 
""
     orderId += orderIdTemp.toString()
 
     Map result = success()

Reply via email to