Create a new Contact_mechanism for a party via JSON RPC

67 views
Skip to first unread message

Akshay patel

unread,
Jun 10, 2016, 3:40:04 AM6/10/16
to tryton

Hello,
 I have couple of questions:

1) How to create a contact_mechanism for a specific party? I am trying to finding how domains works for this?
i.e. How to give party ID when create method.

2) I am unable to create a new party via create method.


Thank you,

Sergi Almacellas Abellana

unread,
Jun 10, 2016, 3:55:56 AM6/10/16
to try...@googlegroups.com
El 10/06/16 a les 09:27, Akshay patel ha escrit:
>
> Hello,
> I have couple of questions:
>
> 1) How to create a contact_mechanism for a specific party? I am trying
> to finding how *domains* works for this?
> i.e. How to give party ID when create method.

Domains are used on search operations to filter records. There are not
used on record creation. To realte a contact mechanims to a party you
have to assign it's party field with the id of the related party.

>
> 2) I am unable to create a new party via create method.
>
>
Can not help if you don't provide more information.
> 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/24d4a9af-deec-4ece-93ee-5b8856426e5d%40googlegroups.com
> <https://groups.google.com/d/msgid/tryton/24d4a9af-deec-4ece-93ee-5b8856426e5d%40googlegroups.com?utm_medium=email&utm_source=footer>.


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

Akshay patel

unread,
Jun 10, 2016, 8:30:04 AM6/10/16
to tryton
{"method":"model.party.contact_mechanism.write","params":[5,"e7fe29ce9296436c9fa8759a75fg047d",{"type":"email"},{"value":"a...@f.co"},{"party":"6"}]}

Is this right JSON RPC body?

Cédric Krier

unread,
Jun 10, 2016, 9:00:03 AM6/10/16
to tryton
Before answering, I want to warn you. You have been told many times on
this mailing list and in private (you got email rejected) that you must
follow the netiquette (http://groups.tryton.org/netiquette). Despite all
those warnings, you keep refusing the rule. So you should not be
astonished that in the future nobody will answer you as you don't show
any respect to your readers.

Here is how you should have answered, quoted and cleaned your post to
let others understand you:

On 2016-06-10 05:10, Akshay patel wrote:
> On Friday, June 10, 2016 at 1:25:56 PM UTC+5:30, Sergi Almacellas Abellana
> wrote:
> >
> > El 10/06/16 a les 09:27, Akshay patel ha escrit:
> > > 2) I am unable to create a new party via create method.
> > >
> > >
> > Can not help if you don't provide more information.

> {"method":"model.party.contact_mechanism.write","params":[5,"e7fe29ce9296436c9fa8759a75fg047d",{"type":"email"},{"value":"a...@f.co"},{"party":"6"}]}
>
> Is this right JSON RPC body?

Not at all. You have been told already that write method take as
parameters a list of:

- user id
- session
- a list of ids to write on
- a dictionary of key/value to write

As you don't give any information about what exactly you try to do (and
also contradiction: create party vs write contact mechanism). You
don't ease at all our the task to answer you. We can only guess what you
try to do.

So if you try to create a contact mechanism:

{"method": "model.party.contact_mechanism.create", "params": [id, session, [{"type": "email", "value": "a...@example.com"}]]}

If you try to write on a contact mechanism:

{"method": "model.party.contact_mechanism.write", "params": [id, session, <list of mechanism is>, {"type": "email", "value": "a...@example.com"}]}


This is the last time, I answer you if you don't change your behaviour.
(And I guess others will follow me).

Regards,
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Sergi Almacellas Abellana

unread,
Jun 10, 2016, 9:03:38 AM6/10/16
to try...@googlegroups.com
El 10/06/16 a les 14:56, Cédric Krier ha escrit:
> This is the last time, I answer you if you don't change your behaviour.
> (And I guess others will follow me).
Yes, I will stop answering too if you don't change the behavior.

Akshay patel

unread,
Jun 10, 2016, 9:20:04 AM6/10/16
to tryton
Thanks a lot for your answer.
But please believe me, sorry to say that I am not getting you
how am I breaking netiquette rules?
can you just show me my errors while posting?, it will be a great help.

Shreedhar Manek

unread,
Jun 11, 2016, 5:45:04 AM6/11/16
to tryton
Hi Akshay,
Have a look at this. It is a way of replying to emails. It's called top posting and it's exactly what I have done right now. This is something that you should not do.

On Friday, 10 June 2016 18:50:04 UTC+5:30, Akshay patel wrote:
Thanks a lot for your answer.
But please believe me, sorry to say that I am not getting you
how am I breaking netiquette rules?
can you just show me my errors while posting?, it will be a great help.


This, on the other hand, is not top posting. I have replied in-line. You can do this using gmail if you click on the small 'show trimmed content' icon on the bottom left. This is of course assuming you use the web client of gmail.

Just delete the stuff that is not relevant to what you're going to say. It makes understanding the context of your email a lot easier for the reader. This is especially useful on a mailing list as there are usually multiple people involved. 

--
Shreedhar Manek

Akshay patel

unread,
Jun 15, 2016, 3:01:53 AM6/15/16
to tryton


Hello,
 
  {"method": "model.party.contact_mechanism.write", "params": [id, session, <list of mechanism is>, {"type": "email", "value": "a...@example.com"}]} 

This will edit the type & value to the list ID of mechanisms.so List ID have same value value to all.

I need like edit different contact mechanism IDs with different values/types.
so e.g. {"method":"model.party.contact_mechanism.write","params":[id,"sessions",[15,33],{"type":"phone","value":"1515"},{"type":"phone","value":"3333"}]}
I need like {"type":"phone","value":"1515"} for ID 15 & {"type":"phone","value":"3333"} for ID 33.

Is this possible?

I also tried my best to avoid top post, but I am sorry if this still not working.
Reply all
Reply to author
Forward
0 new messages