Send information to Tryton using API

Hello !
I was reading the Tryton documentation for the API, I found some fields, like Many2Many or One2One, but I don’t know how represent it when I’m sending the information using the API.
Example
Many2One can be represented in the API like

{
 "model_name":"string"
}

One2Many can be represented like

{
"model_name":[ 
   {"field1":"string1"},
   {"field2":"string2"},
  ]
}

Can you help me with examples of Many2Many and One2One?

Indeed the documentation is not clear about the low level types of those fields. So I filled Issue 11754: Document low level type of relational fields - Tryton issue tracker

For Many2One it is an int and for One2Many it is a tuple of int (but see the documentation remark about the value for create and write calls).

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.