| 1 |
.. OdooRPC documentation master file, created by |
| 2 |
sphinx-quickstart on Sun Jul 6 16:32:50 2014. |
| 3 |
You can adapt this file completely to your liking, but it should at least |
| 4 |
contain the root `toctree` directive. |
| 5 |
|
| 6 |
Welcome to OdooRPC's documentation! |
| 7 |
=================================== |
| 8 |
|
| 9 |
Introduction |
| 10 |
------------ |
| 11 |
|
| 12 |
**OdooRPC** is a Python package providing an easy way to |
| 13 |
pilot your `Odoo <https://www.odoo.com>`_ servers through `RPC`. |
| 14 |
|
| 15 |
Features supported: |
| 16 |
- access to all data model methods (even ``browse``) with an API similar |
| 17 |
to the server-side API, |
| 18 |
- use named parameters with model methods, |
| 19 |
- user context automatically sent providing support for |
| 20 |
internationalization, |
| 21 |
- browse records, |
| 22 |
- execute workflows, |
| 23 |
- manage databases, |
| 24 |
- reports downloading, |
| 25 |
- JSON-RPC protocol (SSL supported), |
| 26 |
|
| 27 |
Quick start |
| 28 |
----------- |
| 29 |
|
| 30 |
How does it work? See below:: |
| 31 |
|
| 32 |
import odoorpc |
| 33 |
|
| 34 |
# Prepare the connection to the server |
| 35 |
odoo = odoorpc.ODOO('localhost', port=8069) |
| 36 |
|
| 37 |
# Check available databases |
| 38 |
print(odoo.db.list()) |
| 39 |
|
| 40 |
# Login |
| 41 |
odoo.login('db_name', 'user', 'passwd') |
| 42 |
|
| 43 |
# Current user |
| 44 |
user = odoo.env.user |
| 45 |
print(user.name) # name of the user connected |
| 46 |
print(user.company_id.name) # the name of its company |
| 47 |
|
| 48 |
# Simple 'raw' query |
| 49 |
user_data = odoo.execute('res.users', 'read', [user.id]) |
| 50 |
print(user_data) |
| 51 |
|
| 52 |
# Use all methods of a model |
| 53 |
if 'sale.order' in odoo.env: |
| 54 |
Order = odoo.env['sale.order'] |
| 55 |
order_ids = Order.search([]) |
| 56 |
for order in Order.browse(order_ids): |
| 57 |
print(order.name) |
| 58 |
products = [line.product_id.name for line in order.order_line] |
| 59 |
print(products) |
| 60 |
|
| 61 |
# Update data through a record |
| 62 |
user.name = "Brian Jones" |
| 63 |
|
| 64 |
For more details and features, see the :ref:`tutorials <tutorials>`, the |
| 65 |
:ref:`Frequently Asked Questions (FAQ) <faq>` and the |
| 66 |
:ref:`API reference <reference>` sections. |
| 67 |
|
| 68 |
Contents |
| 69 |
-------- |
| 70 |
|
| 71 |
.. toctree:: |
| 72 |
:maxdepth: 3 |
| 73 |
|
| 74 |
download_install |
| 75 |
tutorials |
| 76 |
faq |
| 77 |
reference |
| 78 |
|
| 79 |
Supported Odoo server versions |
| 80 |
------------------------------ |
| 81 |
|
| 82 |
`OdooRPC` is tested on all major releases of `Odoo` (starting from 8.0). |
| 83 |
|
| 84 |
Supported Python versions |
| 85 |
------------------------- |
| 86 |
|
| 87 |
`OdooRPC` support Python 2.7, 3.7+. |
| 88 |
|
| 89 |
License |
| 90 |
------- |
| 91 |
|
| 92 |
This software is made available under the `LGPL v3` license. |
| 93 |
|
| 94 |
Bug Tracker |
| 95 |
----------- |
| 96 |
|
| 97 |
Bugs are tracked on `GitHub Issues |
| 98 |
<https://github.com/OCA/odoorpc/issues>`_. In case of trouble, please |
| 99 |
check there if your issue has already been reported. If you spotted it first, |
| 100 |
help us smash it by providing detailed and welcomed feedback. |
| 101 |
|
| 102 |
Credits |
| 103 |
------- |
| 104 |
|
| 105 |
Contributors |
| 106 |
____________ |
| 107 |
|
| 108 |
* Sébastien Alix <[email protected]> |
| 109 |
|
| 110 |
Do not contact contributors directly about support or help with technical issues. |
| 111 |
|
| 112 |
Maintainer |
| 113 |
__________ |
| 114 |
|
| •115 |
This library is maintained by the `OCA <https://odoo-community.org>`_. |
| 116 |
|
| 117 |
OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 118 |
mission is to support the collaborative development of Odoo features and |
| 119 |
promote its widespread use. |
| 120 |
|
| 121 |
Indices and tables |
| 122 |
================== |
| 123 |
|
| 124 |
* :ref:`genindex` |
| 125 |
* :ref:`modindex` |
| 126 |
* :ref:`search` |