Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039804Retail ModulesStoreServerpublic2018-12-14 10:462018-12-17 14:55
AugustoMauch 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
 
mtaal
No
0039804: GenericBusinessPartnerSegmentationEventHandler throws NullPointerException if organization used to route is null
This issue [1] introduced a change that allows to specify the Organization column to be used by the GenericBusinessPartnerSegmentationEventHandler to know to what stores should a business partner be added.

The standard ad_org_id organization is not nullable, but other custom columns might be nullable. When the organization is null, the process fails and throws a NullPointerException

[1] https://issues.openbravo.com/view.php?id=39466 [^]
- Create a nullable foreign key to ad_org_id in c_order (db column, ad column, ad field).
- As System Admin, open the Auto Add Business Partner to Store Tables, and update the record for c_order, by picking the new column in the Referenced Organization Column field.
- Change roles, and create an organization. The save will fail and a NullPointerException will be thrown.
No tags attached.
Issue History
2018-12-14 10:46AugustoMauchNew Issue
2018-12-14 10:46AugustoMauchAssigned To => AugustoMauch
2018-12-14 10:46AugustoMauchTriggers an Emergency Pack => No
2018-12-17 13:38hgbotCheckin
2018-12-17 13:38hgbotNote Added: 0108636
2018-12-17 13:38hgbotStatusnew => resolved
2018-12-17 13:38hgbotResolutionopen => fixed
2018-12-17 13:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/7e58ec2c235690880889cbdc7071eab3afe91b68 [^]
2018-12-17 13:38AugustoMauchReview Assigned To => mtaal
2018-12-17 13:41AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18045#r18045
2018-12-17 14:55mtaalNote Added: 0108647
2018-12-17 14:55mtaalStatusresolved => closed

Notes
(0108636)
hgbot   
2018-12-17 13:38   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 7e58ec2c235690880889cbdc7071eab3afe91b68
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Dec 17 13:37:53 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/7e58ec2c235690880889cbdc7071eab3afe91b68 [^]

Fixes issue 39804: Prevent NPE when routing a record whose organization is null

The GenericBusinessPartnerSegmentationEventHandler class usually decides what mobile servers should
be notified of a new business partner using the mandatory ad_org_id column.

But users can select another organization foreign key, and if that column is empty, the event
handler will not send the business partner info to any mobile server, instead of causing a NPE.

---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/GenericBusinessPartnerSegmentationEventHandler.java
---
(0108647)
mtaal   
2018-12-17 14:55   
tested and reviewed