There's more...

Though it provides a user-friendly syntax like the server, you can use the library just like the normal RPC syntax. To do so, you need to use the odoo.execute method with the model name, method name, and arguments. Here is an example of reading book information in the raw RPC syntax:

import odoorpc

db_name = 'test-12'
user_name = 'admin'
password = 'admin'

# Prepare the connection to the server
odoo = odoorpc.ODOO('localhost', port=8069)
odoo.login(db_name, user_name, password) # login

books_info = odoo.execute('library.book', 'search_read',
[['name', 'ilike', 'odoo']], ['name', 'date_release'])
print(books_info)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset