Benvenuto!

Questo è il forum ufficiale dell'Associazione Odoo Italia. Dopo esserti registrato potrai partecipare ponendo domande o rispondendo a quelle esistenti. Non scordarti di compilare il tuo profilo e consultare le linee guida prima di iniziare a scrivere.

0

0
Marco BRUNO
Il 18/06/19, 09:13

Per partire da qualcosa di semplice come dovrei configurare la scrittura tramite api di un cliente con 2 tags?


La tua risposta

1
Lorenzo Battistini
Il 19/06/19, 06:44

Come libreria consiglio https://pythonhosted.org/OdooRPC/

Per quanto riguarda la scrittura di campi relazionali, in particolare, nel caso dei tags, dei many2many, devi fare riferimento a https://www.odoo.com/documentation/12.0/reference/orm.html#model-reference

Relativamente al metodo write trovi

  • One2many and Many2many use a special “commands” format to manipulate the set of records stored in/associated with the field.

    This format is a list of triplets executed sequentially, where each triplet is a command to execute on the set of records. Not all commands apply in all situations. Possible commands are:

    (0, _, values)
    adds a new record created from the provided value dict.
    (1, id, values)
    updates an existing record of id id with the values in values. Can not be used in create().
    (2, id, _)
    removes the record of id id from the set, then deletes it (from the database). Can not be used in create().
    (3, id, _)
    removes the record of id id from the set, but does not delete it. Can not be used on One2many. Can not be used in create().
    (4, id, _)
    adds an existing record of id id to the set. Can not be used on One2many.
    (5, _, _)
    removes all records from the set, equivalent to using the command 3 on every record explicitly. Can not be used on One2many. Can not be used in create().
    (6, _, ids)
    replaces all existing records in the set by the ids list, equivalent to using the command 5 followed by a command 4 for each id in ids.

    Values marked as _ in the list above are ignored and can be anything, generally 0 or False.


La tua risposta

0
Marco BRUNO
Il 28/06/19, 12:28

Grazie mille!


La tua risposta

Resta informato

Informazioni sulla comunità

Forum ufficiale dell'Associazione Odoo Italia Leggi le linee guida

Strumenti di richiesta

24 follower

Statistiche

Richiesta del: 17/06/19, 08:51
Vista: 1256 volte
Ultimo aggiornamento: 18/06/19, 09:13

 Entra in contatto diretto con la comunità.

Unisciti alla chat Discord.