summaryrefslogtreecommitdiff
path: root/doc/api_integration.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api_integration.rst')
-rw-r--r--doc/api_integration.rst122
1 files changed, 0 insertions, 122 deletions
diff --git a/doc/api_integration.rst b/doc/api_integration.rst
index a0f26d39343..1345915d797 100644
--- a/doc/api_integration.rst
+++ b/doc/api_integration.rst
@@ -1295,128 +1295,6 @@ activated as actual fields on the model.
}
]
-Workflow manipulations
-----------------------
-
-:ref:`reference/workflows` can be moved along by sending them *signals*.
-Instead of using the top-level ``execute_kw``, signals are sent using
-``exec_workflow``.
-
-Signals are sent to a specific record, and possibly trigger a transition on
-the workflow instance associated with the record.
-
-.. container:: doc-aside
-
- .. warning:: this example needs ``account`` module installed
-
- .. switcher::
-
- .. code-block:: python
-
- client = models.execute_kw(
- db, uid, password,
- 'res.partner', 'search_read',
- [[('customer', '=', True)]],
- {'limit': 1, 'fields': [
- 'property_account_receivable_id',
- 'property_payment_term_id',
- 'property_account_position_id']
- })[0]
- invoice_id = models.execute_kw(
- db, uid, password,
- 'account.invoice', 'create', [{
- 'partner_id': client['id'],
- 'account_id': client['property_account_receivable_id'][0],
- 'invoice_line_ids': [(0, False, {'name': "AAA"})]
- }])
-
- models.exec_workflow(
- db, uid, password, 'account.invoice', 'invoice_open', invoice_id)
-
- .. code-block:: php
-
- $client = $models->execute_kw(
- $db, $uid, $password,
- 'res.partner', 'search_read',
- array(array(array('customer', '=', true))),
- array(
- 'limit' => 1,
- 'fields' => array(
- 'property_account_receivable_id',
- 'property_payment_term_id',
- 'property_account_position_id'
- )))[0];
- $invoice_id = $models->execute_kw(
- $db, $uid, $password,
- 'account.invoice', 'create', array(array(
- 'partner_id' => $client['id'],
- 'account_id' => $client['property_account_receivable_id'][0],
- 'invoice_line_ids' => array(array(0, false, array('name' => "AAA")))
- )));
-
- $models->exec_workflow(
- $db, $uid, $password,
- 'account.invoice', 'invoice_open',
- $invoice_id);
-
- .. code-block:: ruby
-
- client = models.execute_kw(
- db, uid, password,
- 'res.partner', 'search_read',
- [[['customer', '=', true]]],
- {limit: 1, fields: %w(property_account_receivable_id property_payment_term_id property_account_position_id)}
- )[0]
- invoice_id = models.execute_kw(
- db, uid, password,
- 'account.invoice', 'create', [{
- partner_id: client['id'],
- account_id: client['property_account_receivable_id'][0],
- invoice_line_ids: [[0, false, {name: "AAA"}]]
- }])
-
- models.exec_workflow(
- db, uid, password,
- 'account.invoice', 'invoice_open', invoice_id)
-
- .. code-block:: java
-
- final Map<String, Object> c = (Map<String, Object>)
- ((Object[])models.execute("execute_kw", asList(
- db, uid, password,
- "res.partner", "search_read",
- asList(
- asList(
- asList("customer", "=", true))),
- new HashMap<String, Object>() {{
- put("limit", 1);
- put("fields", asList(
- "property_account_receivable_id",
- "property_payment_term_id",
- "property_account_position_id"
- ));
- }}
- )))[0];
- final Integer invoice_id = (Integer)models.execute(
- "execute_kw", asList(
- db, uid, password,
- "account.invoice", "create",
- asList(new HashMap<String, Object>() {{
- put("partner_id", c.get("id"));
- put("account_id", ((Object[])c.get("property_account_receivable_id"))[0]);
- put("invoice_line_ids", asList(
- asList(0, false, new HashMap<String, Object>() {{
- put("name", "AAA");
- }})
- ));
- }})
- ));
-
- models.execute(
- "exec_workflow", asList(
- db, uid, password,
- "account.invoice", "invoice_open", invoice_id));
-
Report printing
---------------