Contact_mechanisms

63 views
Skip to first unread message

Akshay patel

unread,
May 27, 2016, 3:05:05 AM5/27/16
to tryton
Hello,

I try to edit contact as follow:

{
"method": "model.party.contact_mechanism.write",
"params": [5, "dcf8e8132dbc4c8986f3e6716b762xa5", [5], {
"skype": "XXXXX"
}, {
"ids": [5],
"values": {
"skype": "XXXXX"
}
}]
}

But I getting Error:

{
  "id": 0,
  "error": [
    "UserError",
    [
      "You try to write on records that don't exist anymore.\n(Document type: party.contact_mechanism)",
      ""
    ]
  ]
}


Even though Record Exists & I am able to change its name.

Thank you

Sergi Almacellas Abellana

unread,
May 27, 2016, 7:43:03 AM5/27/16
to try...@googlegroups.com
El 27/05/16 a les 07:00, Akshay patel ha escrit:
> Hello,
>
> I try to edit contact as follow:

Why are you using directly the API instead the tryton client or proteus
or some web wrapper like flask-tryton?
>
> *{*
> *"method": "model.party.contact_mechanism.write",*
> *"params": [5, "dcf8e8132dbc4c8986f3e6716b762xa5", [5], {*
> *"skype": "XXXXX"*
> *}, {*
> *"ids": [5],*
> *"values": {*
> *"skype": "XXXXX"*
> *}*
> *}]*
> *}*

You have to pass a list of ids, values, ids, values. See:

http://doc.tryton.org/4.0/trytond/doc/ref/models/models.html?highlight=write#trytond.model.ModelStorage.write

Why are you passing two times the same id?

Why you put the ids inside of the second values?

> *
> *
> *But I getting Error:*
> *
> *
> {
> "id": 0,
> "error": [
> "UserError",
> [
> "You try to write on records that don't exist anymore.\n(Document
> type: party.contact_mechanism)",
> ""
> ]
> ]
> }
>
>
> Even though Record Exists & I am able to change its name.
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google
> Groups "tryton" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tryton/01fcfb96-7d3e-4941-a8ec-ffcd6bcf7e68%40googlegroups.com
> <https://groups.google.com/d/msgid/tryton/01fcfb96-7d3e-4941-a8ec-ffcd6bcf7e68%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Akshay patel

unread,
May 27, 2016, 8:55:04 AM5/27/16
to tryton
Hello,

I need to integrate that via API:

How I am passing:

{
"method": "model.party.contact_mechanism.write",
"params": [UserID, "AccessToken", [Edit_PartyID], {
"skype": "Edit SkypeName"
}, {
"ids": [Edit_PartyID],
"values": {
"skype": "Edit SkypeName"
}
}]
}

Sergi Almacellas Abellana

unread,
May 27, 2016, 8:59:45 AM5/27/16
to try...@googlegroups.com
El 27/05/16 a les 13:48, Akshay patel ha escrit:
> Hello,
>
> I need to integrate that via API:
>
> How I am passing:

I don't understand what you say. Could you explain what you need to
integrate? Also a bigger prespective of the problem you are trying to
solve will help to give a better guidance.

I don't want to be rude, but you are not respecting the rules of the
forum (and I have been already warned about it one time). So please
don't top tops on the mailing list or I will stop replying.

You can find the rules here:

http://groups.tryton.org/netiquette
Reply all
Reply to author
Forward
0 new messages