@@ -28,6 +28,53 @@ class OdooClient
2828
2929 const DEFAULT_LIMIT = 100 ;
3030
31+ /**
32+ * The action to perform when updating a one-to-many relation.
33+ * Note: a many-to-many relation is treated like a one-to-many
34+ * relation from each side.
35+ * - Actions 0 to 2 manage CRUD operations on the models being
36+ * linked to.
37+ * - Actions 3 to 6 manage just the relationship between existing
38+ * models.
39+ */
40+ // Adds a new record created from the provided value dict.
41+ // (0, _, values)
42+ const RELATION_CREATE = 0 ;
43+ //
44+ // Updates an existing record of id `id` with the values in values.
45+ // Can not be used in create().
46+ // (1, id, values)
47+ const RELATION_UPDATE = 1 ;
48+ //
49+ // Removes the record of id `id` from the set, then deletes it
50+ // (from the database).
51+ // Can not be used in create().
52+ // (2, id, _)
53+ const RELATION_DELETE = 2 ;
54+ //
55+ // Removes the record of id `id` from the set, but does not delete it.
56+ // Can not be used on One2many. Can not be used in create().
57+ // (3, id, _)
58+ const RELATION_REMOVE_LINK = 3 ;
59+ //
60+ // Adds an existing record of id `id` to the set. Can not be used on One2many.
61+ // (4, id, _)
62+ const RELATION_ADD_LINK = 4 ;
63+ //
64+ // Removes all records from the set, equivalent to using the
65+ // command 3 on every record explicitly.
66+ // Can not be used on One2many.
67+ // Can not be used in create().
68+ // (5, _, _)
69+ const RELATION_REMOVE_ALL_LINKs = 5 ;
70+ //
71+ // Replaces all existing records in the set by the ids list,
72+ // equivalent to using the command 5 followed by a command 4
73+ // for each id in ids.
74+ // Can not be used on One2many.
75+ // (6, _, ids)
76+ const RELATION_REPLACE_ALL_LINKS = 6 ;
77+
3178 /**
3279 * Later versions of the API include a version number e.g. /xmlrpc/2/
3380 */
0 commit comments