How to use API to connect external tools
7. Let's try documentation
10. Hello Michel
16. Create pretty much anything, even fields
18. Error logging !
23. Multi thread write
3. Languages, Libraries XML/JSON RPC
6. Connect, read, write, call methods Basics
19. CSV, multithread Advanced
27. Some real world examples Interface other softwares
32. Thank You Questions ?
1. How to use API to connect external tools SEINLET Nicolas, TECHNICAL CONSULTANT
26. No track in mail.thread Improve performance without tracking modifications in mail.thread
15. Write pictures o Encode the picture file content in base64 o Write it as a regular field
17. Error logging ? o ir.logging model o Readable on the instance
25. Multi thread write/read o Main thread waiting writing threads o Also usable with read (especially with multiple models)
22. Sliced reading o Avoid the « CPU time limit exceeded. » o Read per ~1k records, depending on read fields (O2M, M2O, M2M)
20. Read using CSV o XML ID instead of ID o List of lists instead of list of dicts o Read linked records (O2M, M2M, M20)
8. On saas ? o Do not use Oauth o Set local password for the user o Create a dedicated user o Give required access rights
13. Create an order o Create order and lines in 1 call o Return the created id o Call methods
21. Write using CSV o Write a list of lists instead of a dict o Faster than calling write multiple times o If a line failed, the whole « load » is rolled back o Write on linked fields
4. " " en.wikipedia.org/wiki/XML-RPC XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism. XML RPC
14. o Transaction around the whole method VS each call o What about an error between the SO creation and the confirmation ? RPC vs Method in a module
11. Hello World Connexion Search Read o Supply user_id o Using domain o Return a dict o M2O as list of id and name o Supply list of fields
31. o Free IceCat o Based on Barcode o Odoo on SaaS o Cool e-commerce in minutes o Cool POS in minutes o Source code : https://bitbucket.org/nseinlet/xperience2015 Ex 3 : Pictures from web service
29. Ex 1 : Export pickings List pickings Find order List packs List items Generate XML o Add custom fields for export date o Customize barcode interface for packs o Check weight of all products
9. Read o Using python o Using openerplib o Using jsonrpc Connexion Search Read o Connect to instance o Search for partners called Fletcher o Display name and company name
12. Write Connexion Search partner Search products o Check if all informations exists before create order (Products, partners, ...) o Avoid multiple call for the same object creation (Use magic numbers) o Avoid read when unnecessary o Call methods on objects Create quotation Confirm order
24. Multi thread write o Write ~400 records per thread o Better writing rate o Write on linked fields o Harder to manage errors o Avoid using all Odoo workers → 1 thread = 1 Worker o 1 failing line = the whole thread is rolled back o If many fields, or linked fields, or binary fields, take care of CPU time → lower the number of records o Avoid too many threads on the script running machine → change the place of the semaphore
2. o A carrier needs picking information on a regular basis in a file stored on a local computer o A customer wants to send orders and receive invoices using EDIFACT o An Odoo user wants to set pictures on products (50k+) based on an external product database available on Internet o Import external products catalogue, and update prices on a regular basis o How to do it with Odoo ? o Is it possible to automate ? o Even on SaaS ? Introduction
5. o Libraries exists in many languages o Well documented on the Odoo side o https://www.odoo.com/documentation/master/api_integration.html o Sample in many langages in the official documentation o ACL and Record rules are respected o Access to any object o Call every method, except browse o number of high-level APIs in various langages o https://github.com/akretion/ooor o https://pypi.python.org/pypi/openerp-client-lib/1.1.2 o https://github.com/tinyerp/erppeek o ... XML RPC
28. o Medium size company o Carrier with on-site software o Must generate text files on disk o Odoo on SaaS Ex 1 : Export pickings Wizard Fully integrated Manual trigger Easy use Manual save of file Easy maintenance XML RPC Fully automatic Harder maintenance Delay due to cron Transparent for user
30. o Small size company o Customers with EDIFACT o EDI platform require local windows software o Odoo on SaaS Ex 2 : EDIFACT link Wizard Same interface No direct access to disk Easy maintenance Easier « on premise » XML RPC No matter the location of the server Harder maintenance Code readability Do not break the server in case of error Transparent for user
- 1642 Total Views
- 491 Website Views
- 1151 Embeded Views
- Social Shares
- 0 Likes
- 0 Dislikes
- 0 Comments
- 0 Facebook
- 0 Twitter
- 0 Google+
- 2 www.odoo.com
- 2 www.tinyerp.org
- 1 www.google.it
- 2 onlinesync.odoo.com
Keynote: Odoo 9 New Features40964 Views .
Odoo 9 New Design- The rationales behind it11378 Views .
Odoo Mobile Development Framework & App build with it11186 Views .
Open Source Licenses9235 Views .
How A/B testing can help you optimize your website8115 Views .
Shipper integration - UPS, DHL, FedEx7487 Views .
UX best practices to create your module6062 Views .
Keynote: Odoo Strategy 20155895 Views .
Import and export data - Tips & Tricks5793 Views .
How to use Odoo in a Restaurant5518 Views .
Odoo 9: New Business Model5384 Views .
Odoo cms Performance Comparison and Optimisation4707 Views .
Contributing to the Odoo Community Association (OCA)4616 Views .
VOIP: One-click Button to Automate Calls4027 Views .
First steps in Odoo dev3909 Views .
Odoo 9 New Design- Usability Methodology3794 Views .
Advanced Features of the API3699 Views .
How to use Odoo in a service company3671 Views .
Advanced barcodes management3626 Views .