Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4850 มุมมอง

In may application i want to call python def 

and i m doing something like these:

bg = new AccountSharing(getApplicationContext(), OUser.current(this));

OLog.log(String.valueOf(bg.getServerDataHelper()==null));              

 //which return true, it return false when the app is newly installed and as  in Odoologin class sets the odoo value of application class

Object o=bg.getServerDataHelper().callMethod("account.sharing","send_invite_via_email",new OArguments(),new HashMap<String, Object>(),new HashMap<String, Object>());

And i get these error:

com.test E/AndroidRuntime: FATAL EXCEPTION: IntentService[OdooRegisterService]

Process: com.test, PID: 5022 java.lang.NullPointerException: Attempt to read from field 'odoo.helper.utils.gson.OdooResult odoo.helper.utils.gson.OdooResponse.result' on a null object reference at odoo.wrapper.OdooWrapper.authenticate(OdooWrapper.java:448) at odoo.wrapper.OdooWrapper.authenticate(OdooWrapper.java:441) at com.om.OdooRegisterService.onHandleIntent(OdooRegisterService.java:52) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61)

The main issue is caused due to 

OLog.log(String.valueOf(app.getOdoo(OUser.current(this))==null));

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

it must be called in AsyncTask or new Thread
this must resolve it

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มิ.ย. 17
8076
0
พ.ย. 16
3495
0
พ.ย. 16
2897
0
พ.ย. 16
3340
0
พ.ย. 16
3295