SlideShare a Scribd company logo
www.cybrosys.com
Odoo Web Services
INTRODUCTION
• Web services are a set of tools available over the internet or intranet networks which
use the standardized messaging system to transfer data between applications or
systems.
• Web services allow interaction between different systems or applications using
standard libraries such as HTML, XML, WSDL, and SOAP.
• Web services are not limited to a single programming language.
• Odoo web services can be of two types –> XML-RPC and JSON-RPC
XML-RPC
• XML-RPC allows to connect programs running on different programming languages
and systems working on different operating systems.
• XML-RPC can be used with programming languages like Python, Java, C, C++, PHP,
Perl, Ruby, .Net etc.
• Discussing how to use xml-rpc in Python
Connecting With Database
• To connect with an Odoo database we have to define URL of Odoo server, a name of the
database used, username and password.
• A simple way to check whether authentication is correct or not is to check the version of
Odoo running.
• If authentication is correct we will need the user id to access data.
• It can be read using “uid = common. Authenticate (dB, user, pwd, {})”
Example: To connect to a local host and read the version of Odoo service running
Reading Records
Records of a model can be read using the search function. First, we need to define a model.
models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
To search for record in a model,
models.execute_kw(db, uid, pwd,'model.name','search',[[[any_domain]]])
Here domain is a mandatory field. You should keep it empty(like this [[[]]] ) if no domain is
required. Also, we can keep limit for the number of records we need to get using limit.
Example: Print ids of 3 records from model account. Invoice with origin field equals
false
Note: To read or write a record the logged user should have permission for read and write respectively
To get count we can use search_count instead of search for getting the number of records in our search.
To read a record we can use read instead of search and we need to define all fields in model which we need.
models.execute_kw(db, uid, pwd,'model.name','read',[ids],{'fields':['field_1', 'field_2']})
we can also use search_read which is equalant to search followed by read
models.execute_kw(db, uid, pwd,'model.name','search_read',[[[domain]]],{'fields':['field_1', 'field_2']})
Example: Print name and state of all invoices against customer agrolait
Managing Records
To create, update or unlink a record we can use create(), write(), and unlink() respectively
models.execute_kw(db, uid, pwd, 'model.name','create', [{'field_name':'field_value'}])
models.execute_kw(db, uid, pwd, 'model.name', 'write',
[[id]],[{'field_name':'field_value'}])
models.execute_kw(db, uid, pwd,'model.name','unlink',[[id]])
Example: Create a customer named “test user”, update his name to “User 23”. And finally
delete his record.
Note : When creating records of a model we might want to define all required fields(if they are not
given by default in Odoo). In the above example, we need to define login for the user.
Json-RPC
Similar to XML-RPC we can interact with Odoo server using Json-RPC.
General working is to establish a connection between two peers.
During connection, a peer may invoke methods from other by sending the request.
And receiver will reply with a response.
In Odoo Json-RPC can be implemented using standard python libraries(like json, random,
urllib2) or using package jsonrpclib.
To connect with Odoo server using jsonrpclib we can use
url = “host url with port”
server = jsonrpclib.Server(url)
Refer this link for more:
https://www.cybrosys.com/blog/odoo-web-services
Thank You !
Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park,
Kakkancherry,
Calicut University P.O.
Calicut
Kerala, India - 673635.
Cybrosys Ltd
15, ST Antonys Road,
Forest Gate, London
England,
E79QA.
Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, Kerala,
India-682030.

More Related Content

What's hot (20)

PDF
Word 2 heseg
Computer lesson
 
DOCX
It101 lab11 use case
BPurev
 
DOC
0004 20191108 mns iso iec 27001_2019_body_v1.0
Mr Nyak
 
PPT
Pp Lect12 13
ulziibaatar
 
PPTX
Лекц №15
Amarsaikhan Tuvshinbayar
 
PPTX
Өгөгдлийн бүтэц 14
International Ulaanbaatar University
 
DOC
ертөнцийн гурав
Gegeen_73
 
PDF
эрүүл мэндийн статистикийн үндсэн үзүүлэлтүүдийг тооцох аргачлал
Serod Khuyagaa
 
ODP
монгол хэл
tuul1420
 
PPTX
C++ програмчлал 2
Gan-Erdene Myagmar
 
PDF
Olonlog n6
amartuvshind
 
PPTX
лекц-3
Chinzorig Undarmaa
 
PPTX
Microsoft office visio ашиглах
Otgoo Kh
 
PPTX
It101 lect16
Nergui Batjargal
 
PDF
СБАХ-ийн дүрэм, журам
GreengoldMongolia
 
PPTX
Нийгмийн ажлын онол арга зүй 2015-10-14
E-Gazarchin Online University
 
PPTX
Жинхэнэ нэр
Ge Go
 
DOCX
Microsoft word
monhgerel
 
PDF
Lecture8
Batsaikhanshdee
 
DOC
Ээлжит хичээлийн хөтөлбөрүүд 9-р анги мэдээлэлзүй
roza_toshke
 
Word 2 heseg
Computer lesson
 
It101 lab11 use case
BPurev
 
0004 20191108 mns iso iec 27001_2019_body_v1.0
Mr Nyak
 
Pp Lect12 13
ulziibaatar
 
Лекц №15
Amarsaikhan Tuvshinbayar
 
Өгөгдлийн бүтэц 14
International Ulaanbaatar University
 
ертөнцийн гурав
Gegeen_73
 
эрүүл мэндийн статистикийн үндсэн үзүүлэлтүүдийг тооцох аргачлал
Serod Khuyagaa
 
монгол хэл
tuul1420
 
C++ програмчлал 2
Gan-Erdene Myagmar
 
Olonlog n6
amartuvshind
 
лекц-3
Chinzorig Undarmaa
 
Microsoft office visio ашиглах
Otgoo Kh
 
It101 lect16
Nergui Batjargal
 
СБАХ-ийн дүрэм, журам
GreengoldMongolia
 
Нийгмийн ажлын онол арга зүй 2015-10-14
E-Gazarchin Online University
 
Жинхэнэ нэр
Ge Go
 
Microsoft word
monhgerel
 
Lecture8
Batsaikhanshdee
 
Ээлжит хичээлийн хөтөлбөрүүд 9-р анги мэдээлэлзүй
roza_toshke
 

Viewers also liked (9)

PPTX
How to configure PyCharm for Odoo development in Windows?
Celine George
 
PPTX
Odoo (OpenERP) - Creating a module
Tarun Behal
 
PPTX
Timesheet based payroll
Celine George
 
PPTX
Xml operations in odoo
Celine George
 
PDF
Development Odoo Basic
Mario IC
 
PPTX
Widgets in odoo
Celine George
 
PDF
User Manual For Crafito Odoo Theme
AppJetty
 
PDF
Odoo - Create themes for website
Odoo
 
PDF
Odoo - Backend modules in v8
Odoo
 
How to configure PyCharm for Odoo development in Windows?
Celine George
 
Odoo (OpenERP) - Creating a module
Tarun Behal
 
Timesheet based payroll
Celine George
 
Xml operations in odoo
Celine George
 
Development Odoo Basic
Mario IC
 
Widgets in odoo
Celine George
 
User Manual For Crafito Odoo Theme
AppJetty
 
Odoo - Create themes for website
Odoo
 
Odoo - Backend modules in v8
Odoo
 
Ad

Similar to Odoo Web Services (20)

PPTX
Node js crash course session 5
Abdul Rahman Masri Attal
 
PDF
Building Services With gRPC, Docker and Go
Martin Kess
 
PDF
Understanding ORM in Odoo 18: Methods and Best Practices
Shiv Technolabs Pvt. Ltd.
 
ODP
TangoWithDjango - ch8
Asika Kuo
 
PDF
Do you know what your drupal is doing? Observe it!
Luca Lusso
 
PDF
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
lennartkats
 
PDF
Mongodb
Thiago Veiga
 
PDF
Application development with Oracle NoSQL Database 3.0
Anuj Sahni
 
PDF
Enable Database Service over HTTP or IBM WebSphere MQ in 15_minutes with IAS
Invenire Aude
 
PPTX
Eagle6 mongo dc revised
MongoDB
 
PPTX
Eagle6 Enterprise Situational Awareness
MongoDB
 
PDF
Building API Powered Chatbot & Application using AI SDK (1).pdf
diliphembram121
 
PDF
Building API Powered Chatbot & Application using AI SDK.pdf
diliphembram121
 
DOC
Tutorial Solution
vikram singh
 
PPTX
odoo 11.0 development (CRUD)
Mohamed Magdy
 
PDF
JSONSchema with golang
Suraj Deshmukh
 
PDF
Basic API Creation with Node.JS
Azilen Technologies Pvt. Ltd.
 
PDF
Develop an App with the Odoo Framework
Odoo
 
PPT
lecture 6 javascript event and event handling.ppt
ULADATZ
 
Node js crash course session 5
Abdul Rahman Masri Attal
 
Building Services With gRPC, Docker and Go
Martin Kess
 
Understanding ORM in Odoo 18: Methods and Best Practices
Shiv Technolabs Pvt. Ltd.
 
TangoWithDjango - ch8
Asika Kuo
 
Do you know what your drupal is doing? Observe it!
Luca Lusso
 
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
lennartkats
 
Mongodb
Thiago Veiga
 
Application development with Oracle NoSQL Database 3.0
Anuj Sahni
 
Enable Database Service over HTTP or IBM WebSphere MQ in 15_minutes with IAS
Invenire Aude
 
Eagle6 mongo dc revised
MongoDB
 
Eagle6 Enterprise Situational Awareness
MongoDB
 
Building API Powered Chatbot & Application using AI SDK (1).pdf
diliphembram121
 
Building API Powered Chatbot & Application using AI SDK.pdf
diliphembram121
 
Tutorial Solution
vikram singh
 
odoo 11.0 development (CRUD)
Mohamed Magdy
 
JSONSchema with golang
Suraj Deshmukh
 
Basic API Creation with Node.JS
Azilen Technologies Pvt. Ltd.
 
Develop an App with the Odoo Framework
Odoo
 
lecture 6 javascript event and event handling.ppt
ULADATZ
 
Ad

More from Celine George (20)

PPTX
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
PPTX
Blanket Order in Odoo 17 Purchase App - Odoo Slides
Celine George
 
PPTX
Latest Features in Odoo 18 - Odoo slides
Celine George
 
PPTX
How to Define Translation to Custom Module And Add a new language in Odoo 18
Celine George
 
PPTX
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PPTX
How to Manage Promotions in Odoo 18 Sales
Celine George
 
PPTX
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
PPTX
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
Blanket Order in Odoo 17 Purchase App - Odoo Slides
Celine George
 
Latest Features in Odoo 18 - Odoo slides
Celine George
 
How to Define Translation to Custom Module And Add a new language in Odoo 18
Celine George
 
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
How to Manage Promotions in Odoo 18 Sales
Celine George
 
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
Controller Request and Response in Odoo18
Celine George
 

Recently uploaded (20)

PDF
Flexible Metal Hose & Custom Hose Assemblies
McGill Hose & Coupling Inc
 
PPTX
World First Cardiovascular & Thoracic CT Scanner
arineta37
 
PDF
Blind Spots in Business: Unearthing Hidden Challenges in Today's Organizations
Crimson Business Consulting
 
PDF
Redefining Punjab’s Growth Story_ Mohit Bansal and the Human-Centric Vision o...
Mohit Bansal GMI
 
PDF
Kirill Klip GEM Royalty TNR Gold Presentation
Kirill Klip
 
PDF
kcb-group-plc-2024-integrated-report-and-financial-statements (3).pdf
DanielNdegwa10
 
PPTX
Hackathon - Technology - Idea Submission Template -HackerEarth.pptx
nanster236
 
PPTX
epi editorial commitee meeting presentation
MIPLM
 
PDF
Raman Bhaumik - A Passion For Service
Raman Bhaumik
 
PPTX
LESSON2.Uniquesellingpropositionandvalueproposition-180725234133.pptx
dioselasolidor1
 
PPTX
Drive Operational Excellence with Proven Continuous Improvement Strategies
Group50 Consulting
 
PDF
Why Unipac Equipment Leads the Way Among Gantry Crane Manufacturers in Singap...
UnipacEquipment
 
PDF
NJ GST Collection Summary - June2025.pdf
writer28
 
PPTX
Master and Business Administration II Next MBA
RobertoOrellana44
 
PDF
Buy Verified Payoneer Account – 100% Best With All Documents.pdf
buypaypalaccountsee buypaypalaccounts
 
PDF
Top Farewell Gifts for Seniors Under.pdf
ThreadVibe Living
 
PDF
Connecting Startups to Strategic Global VC Opportunities.pdf
Google
 
DOCX
How to Choose the Best Dildo for Men A Complete Buying Guide.docx
Glas Toy
 
PDF
Securiport - A Global Leader
Securiport
 
PDF
LEWIONICS SCO Company Profile UAE JULY 2025
Natalie Lewes
 
Flexible Metal Hose & Custom Hose Assemblies
McGill Hose & Coupling Inc
 
World First Cardiovascular & Thoracic CT Scanner
arineta37
 
Blind Spots in Business: Unearthing Hidden Challenges in Today's Organizations
Crimson Business Consulting
 
Redefining Punjab’s Growth Story_ Mohit Bansal and the Human-Centric Vision o...
Mohit Bansal GMI
 
Kirill Klip GEM Royalty TNR Gold Presentation
Kirill Klip
 
kcb-group-plc-2024-integrated-report-and-financial-statements (3).pdf
DanielNdegwa10
 
Hackathon - Technology - Idea Submission Template -HackerEarth.pptx
nanster236
 
epi editorial commitee meeting presentation
MIPLM
 
Raman Bhaumik - A Passion For Service
Raman Bhaumik
 
LESSON2.Uniquesellingpropositionandvalueproposition-180725234133.pptx
dioselasolidor1
 
Drive Operational Excellence with Proven Continuous Improvement Strategies
Group50 Consulting
 
Why Unipac Equipment Leads the Way Among Gantry Crane Manufacturers in Singap...
UnipacEquipment
 
NJ GST Collection Summary - June2025.pdf
writer28
 
Master and Business Administration II Next MBA
RobertoOrellana44
 
Buy Verified Payoneer Account – 100% Best With All Documents.pdf
buypaypalaccountsee buypaypalaccounts
 
Top Farewell Gifts for Seniors Under.pdf
ThreadVibe Living
 
Connecting Startups to Strategic Global VC Opportunities.pdf
Google
 
How to Choose the Best Dildo for Men A Complete Buying Guide.docx
Glas Toy
 
Securiport - A Global Leader
Securiport
 
LEWIONICS SCO Company Profile UAE JULY 2025
Natalie Lewes
 

Odoo Web Services

  • 2. INTRODUCTION • Web services are a set of tools available over the internet or intranet networks which use the standardized messaging system to transfer data between applications or systems. • Web services allow interaction between different systems or applications using standard libraries such as HTML, XML, WSDL, and SOAP. • Web services are not limited to a single programming language. • Odoo web services can be of two types –> XML-RPC and JSON-RPC
  • 3. XML-RPC • XML-RPC allows to connect programs running on different programming languages and systems working on different operating systems. • XML-RPC can be used with programming languages like Python, Java, C, C++, PHP, Perl, Ruby, .Net etc. • Discussing how to use xml-rpc in Python
  • 4. Connecting With Database • To connect with an Odoo database we have to define URL of Odoo server, a name of the database used, username and password. • A simple way to check whether authentication is correct or not is to check the version of Odoo running. • If authentication is correct we will need the user id to access data. • It can be read using “uid = common. Authenticate (dB, user, pwd, {})”
  • 5. Example: To connect to a local host and read the version of Odoo service running
  • 6. Reading Records Records of a model can be read using the search function. First, we need to define a model. models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url)) To search for record in a model, models.execute_kw(db, uid, pwd,'model.name','search',[[[any_domain]]]) Here domain is a mandatory field. You should keep it empty(like this [[[]]] ) if no domain is required. Also, we can keep limit for the number of records we need to get using limit.
  • 7. Example: Print ids of 3 records from model account. Invoice with origin field equals false
  • 8. Note: To read or write a record the logged user should have permission for read and write respectively To get count we can use search_count instead of search for getting the number of records in our search. To read a record we can use read instead of search and we need to define all fields in model which we need. models.execute_kw(db, uid, pwd,'model.name','read',[ids],{'fields':['field_1', 'field_2']}) we can also use search_read which is equalant to search followed by read models.execute_kw(db, uid, pwd,'model.name','search_read',[[[domain]]],{'fields':['field_1', 'field_2']})
  • 9. Example: Print name and state of all invoices against customer agrolait
  • 10. Managing Records To create, update or unlink a record we can use create(), write(), and unlink() respectively models.execute_kw(db, uid, pwd, 'model.name','create', [{'field_name':'field_value'}]) models.execute_kw(db, uid, pwd, 'model.name', 'write', [[id]],[{'field_name':'field_value'}]) models.execute_kw(db, uid, pwd,'model.name','unlink',[[id]])
  • 11. Example: Create a customer named “test user”, update his name to “User 23”. And finally delete his record. Note : When creating records of a model we might want to define all required fields(if they are not given by default in Odoo). In the above example, we need to define login for the user.
  • 12. Json-RPC Similar to XML-RPC we can interact with Odoo server using Json-RPC. General working is to establish a connection between two peers. During connection, a peer may invoke methods from other by sending the request. And receiver will reply with a response.
  • 13. In Odoo Json-RPC can be implemented using standard python libraries(like json, random, urllib2) or using package jsonrpclib. To connect with Odoo server using jsonrpclib we can use url = “host url with port” server = jsonrpclib.Server(url)
  • 14. Refer this link for more: https://www.cybrosys.com/blog/odoo-web-services
  • 15. Thank You ! Cybrosys Technologies Pvt. Ltd. Neospace, Kinfra Techno Park, Kakkancherry, Calicut University P.O. Calicut Kerala, India - 673635. Cybrosys Ltd 15, ST Antonys Road, Forest Gate, London England, E79QA. Cybrosys Technologies Pvt. Ltd. 1st Floor, Thapasya Building, Infopark, Kakkanad, Kochi, Kerala, India-682030.