December 2018
Beginner to intermediate
404 pages
10h 14m
English
For one-to-many and many-to-many fields, instead of a single ID, a list of related IDs is expected. Furthermore, several operations can be performed—we may want to replace the current list of related records with a new one, or append a few records to it, or even unlink some records.
To support write operations on to-many fields, we use a special syntax in the eval attribute. To write to a to-many field, we use a list of triples. Each triple is a write command that does different things according to the code used in the first element.
To overwrite the list of authors of a book, we would use the following code:
<field name="author_ids"
eval="[(6, 0, [ref('res_partner_alexandre'), ref('res_partner_holger')] ...Read now
Unlock full access