Odoo-mobile / framework

Odoo Mobile Framework
https://play.google.com/store/apps/dev?id=8607973775002477408
Other
327 stars 374 forks source link

[FIX] framework: Odoo version and OUser parses #254

Closed r-mckay closed 7 years ago

r-mckay commented 7 years ago

This patch fixes some parses done during the OUser and OdooVersion initializations. Previously, there were issues with the types given to the parsers (Integer vs. String). We now check the type of the variables that were in conflict.

dpr-odoo commented 7 years ago

@r-mckay Have you checked it with latest one? In which odoo version you are getting parse issue? can you specify the Odoo Version and also trace you are getting.

r-mckay commented 7 years ago

Thank you for your answer @dpr-odoo We are targeting a V8 version. This happens just after the login.

Here is a stacktrace (user_id example):

Key user_id expected Integer but value was a java.lang.String. The default value 0 was returned. Attempt to cast generated internal exception: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer at android.os.BaseBundle.getInt(BaseBundle.java:801) at android.os.BaseBundle.getInt(BaseBundle.java:783) at com.odoo.core.support.OUser.fillFromBundle(OUser.java:204) at com.odoo.core.support.OUser.setFromBundle(OUser.java:218) at ....onLoginSuccess(...LoginActivity.java:381) at com.odoo.core.rpc.wrapper.OdooWrapper$8.onResponse(OdooWrapper.java:904) at com.odoo.core.rpc.wrapper.OdooWrapper.onResponse(OdooWrapper.java:967) at com.odoo.core.rpc.wrapper.OdooWrapper.onResponse(OdooWrapper.java:73) at com.android.volley.toolbox.JsonRequest.deliverResponse(JsonRequest.java:65) at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

dpr-odoo commented 7 years ago

Hello @r-mckay

We have tested it and we are not able to reproduce this error for Odoo 8.0

r-mckay commented 7 years ago

Thank you for your feedback @dpr-odoo Well that is actually quite interesting. We'll dig deeper into this and will let you know if we have more information.

dpr-odoo commented 7 years ago

@r-mckay closing PR. Feel free to reopen it if issue exists. Thanks.