Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

odoo android mobile framework

By
Amzz
on 10/20/16, 5:15 AM 231 views

In my application whenever i try to insert or update the relational value of ONE2MANY my app crashes.

10-20 14:41:19.195 2964-2964/com.test E/com.odoo.addons.healthvault.details.PeakFlow_details[onOptionsItemSelected]: {fev6=341.0, pef=122, advance=true, note_info=true, date=2016-09-23 12:52:02, measurement_flag_ids={Append=[[{name=5}, {name=6}]]}, fev=121.0, note=false}10-20 14:41:19.224 2964-2964/com.test W/System.err: java.io.NotSerializableException: android.text.SpannableStringBuilder10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1344)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.util.HashMap.writeObject(HashMap.java:976)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.lang.reflect.Method.invoke(Native Method)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1033)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:959)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:360)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1054)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.util.ArrayList.writeObject(ArrayList.java:648)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.lang.reflect.Method.invoke(Native Method)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1033)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeNewArray(ObjectOutputStream.java:1185)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1642)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)10-20 14:41:19.224 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:959)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:360)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1054)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.util.HashMap.writeObject(HashMap.java:976)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.lang.reflect.Method.invoke(Native Method)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1033)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:959)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:360)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1054)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)10-20 14:41:19.225 2964-2964/com.test W/System.err: at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)10-20 14:41:19.225 2964-2964/com.test W/System.err: at com.odoo.core.utils.OObjectUtils.objectToByte(OObjectUtils.java:14)10-20 14:41:19.225 2964-2964/com.test W/System.err: at com.odoo.core.orm.OValues.toContentValues(OValues.java:123)10-20 14:41:19.225 2964-2964/com.test W/System.err: at com.odoo.core.orm.OModel.update(OModel.java:886)10-20 14:41:19.225 2964-2964/com.test W/System.err: at com.odoo.addons.healthvault.details.PeakFlow_details.onOptionsItemSelected(PeakFlow_details.java:161)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.app.Activity.onMenuItemSelected(Activity.java:2918)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:421)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:188)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:103)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:103)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:69)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.widget.Toolbar$1.onMenuItemClick(Toolbar.java:202)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:761)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:810)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:957)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:947)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:618)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.support.v7.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:155)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.view.View.performClick(View.java:5207)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.view.View$PerformClick.run(View.java:21168)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.os.Handler.handleCallback(Handler.java:746)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.os.Looper.loop(Looper.java:148)10-20 14:41:19.225 2964-2964/com.test W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5443)10-20 14:41:19.226 2964-2964/com.test W/System.err: at java.lang.reflect.Method.invoke(Native Method)10-20 14:41:19.226 2964-2964/com.test W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)10-20 14:41:19.226 2964-2964/com.test W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)10-20 14:41:19.241 2964-2964/com.test D/AndroidRuntime: Shutting down VM10-20 14:41:19.242 2964-2964/com.test E/AndroidRuntime: FATAL EXCEPTION: main Process: com.test, PID: 2964 java.lang.ClassCastException: java.lang.String cannot be cast to byte[] at com.odoo.core.orm.provider.BaseModelProvider.storeUpdateRelationRecords(BaseModelProvider.java:254) at com.odoo.core.orm.provider.BaseModelProvider.update(BaseModelProvider.java:236) at android.content.ContentProvider$Transport.update(ContentProvider.java:355) at android.content.ContentResolver.update(ContentResolver.java:1360) at com.odoo.core.orm.OModel.update(OModel.java:885) at com.odoo.addons.healthvault.details.PeakFlow_details.onOptionsItemSelected(PeakFlow_details.java:161) at android.app.Activity.onMenuItemSelected(Activity.java:2918) at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:421) at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:188) at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:103) at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:103) at android.support.v7.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:69) at android.support.v7.widget.Toolbar$1.onMenuItemClick(Toolbar.java:202) at android.support.v7.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:761) at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:810) at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152) at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:957) at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:947) at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:618) at android.support.v7.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:155) at android.view.View.performClick(View.java:5207) at android.view.View$PerformClick.run(View.java:21168) at android.os.Handler.handleCallback(Handler.java:746) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

1
Amzz
On 10/20/16, 11:44 AM

it workz fine if i do as  the documentation says like 

OValues o1=new OValues();o1.put("name","amar");

OLog.log("val "+o1.toString());

o.put("measurement_flag_ids",new RelValues().append(o1));

OLog.log(o.toString()); bg.update(row.getInt(OColumn.ROW_ID), o);

But if i declared a global variable like

List<OValues> val=new ArrayList<>();

populates these value

new MaterialDialog.Builder(details.this)

.title("Details")

.customView(vi,false)

.positiveText("save")

.cancelable(false)

.onPositive(new MaterialDialog.SingleButtonCallback() {

@Override

public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {

val.add(sc.getValues());

dialog.dismiss(); }

})

.negativeText("cancel")

.build() .show();

from getting the OForm

o.put("measurement_flag_ids",new RelValues().append(val.toArray()));

it crashes..

1
marshall
On 10/20/16, 6:53 AM

the values tat are generated by

OForm.getValues().toString()={fev6=341.0,

pef=122,

advance=true,

note_info=true,

date=2016-09-23 12:52:02,

measurement_flag_ids={Append=[{name=5}, {name=6}, {name=7}]},

fev=121.0, note=false

}


normally this exception is cause by http://stackoverflow.com/questions/13895867/java-io-notserializableexception


try makin the OModel implementing Serializable
and
transient OColumn measurement_flag_ids

Thanxx but that didnt worked.

Amzz
on 10/20/16, 9:17 AM

can u upload the Code!!!!

marshall
on 10/20/16, 11:08 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/20/16, 5:15 AM
Seen: 231 times
Last updated: 10/20/16, 11:44 AM