File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -127,11 +127,19 @@ fail to make the OpenERP/Odoo version number clear.
127127
128128# Setting Relationships
129129
130- TODO (it's fairly simple once explained)
130+ There are helpers to create the relationships data.
131+ Just a simple example, replacing all invoices belonging to a
132+ partner witn a new set of invoices:
131133
132- # TODO
134+ ``` php
135+ $invoiceIds = ... // array or collection of resource IDs for the invoices to link
133136
134- * Examples on how relationships are managed are needed, since they are
135- one of the areas that cause the most confusion. It's actuall pretty
136- easy once you see the technique, though a helper may be useful to
137- put together the data structure needed.
137+ $response = $client->write(
138+ 'res.partner',
139+ $partnerResourceId,
140+ [
141+ 'invoice_ids' => $client->relationReplaceAllLinks($invoiceIds),
142+ // other optional fields and relations can be set here too
143+ ]
144+ );
145+ ```
You can’t perform that action at this time.
0 commit comments