-
Book Overview & Buying
-
Table Of Contents
Odoo 10 Development Essentials
By :
Let's do something interesting with the RPC API. Odoo provides a simple app for notes. What if users could manage their personal notes directly from their computer's desktop? Let's write a simple Python application to do just that, as shown in the following screenshot:

For clarity, we will split it into two files: one dealing with interactions with the server backend, note_api.py, and another with the graphical user interface, note_gui.py.
We will create a class to set up the connection and store its information. It should expose two methods: get() to retrieve task data and set() to create or update tasks.
Select a directory to host the application files and create the note_api.py file. We can start by adding the class constructor, as follows:
import xmlrpclib
class NoteAPI():
def __init__(self, srv, db, user, pwd):
common = xmlrpclib.ServerProxy(
'%s/xmlrpc/2/common' % srv...