Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Details and examples on the accounting API?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
accountingapiledgerxero
1 Respondre
13656 Vistes
Avatar
Jason Judge

I am looking for an accounting package to use for the back-end grunt work for a PHP application, and am evaluating what is available. What I can't tell, is just how the API interacts with the accounting functionality of OpenERM.

From what I can tell, the API I have seen described in the docs is one that is designed to split the very front end GUI interface of the ERP system from the business functionality. So the API supports the GUI pages, if I understand it correctly.

What I would be looking for is something lower level than that - I may want to generate an invoice, accept a payment, add an account, update a contact, move cache between ledger accounts, create and apply a credit note, etc. Is the API able to support that kind of need? If there are any examples of this being done, I would love to see it. But so far, I simply cannot find any examples or documentation that puts it all into context, so I just cannot tell if OpenERP is the tool I need.

Just by comparison, I have looked at Xero, and the API is spot-on, just what I need. The problem with Xero is that it aims itself at companies of a limited size, with a limited number of API transactions. They have firmly drawn a box around their aimed market segment. Being Open Source, OpenERP is more limited by the resources that you want to throw at it, so you have more control. That's cool, but I still need to see how I would use it before investing more time into exploring its use in our wider systems.

Thanks :-)

-- Jason

1
Avatar
Descartar
Jason Judge
Autor

If I can just widen this question out a bit, in a tr;dr way: has anyone here used the API to automatically manage the ledger and other business objects in the accounting module from an application? Are there any example applications or notes that I could look at? Thanks :-)

Avatar
Olivier Dony (odo)
Best Answer

Hi Jason,

The OpenERP API can definitely do what you want, and the reason is very simple: the UI indeed uses that very same API to talk with the backend. So what the UI can do, you can do it programmatically too.

However the OpenERP API is designed in a completely generic way: it is structured around models (i.e. business classes backed by database tables), which by default only offer a very simple set of methods: the CRUD basics, named create(), read(), write() and unlink()) + some utilities like import_data(), export_data(), etc. Have a look at the technical documentation for the details. The technical memento may also be a good reference. So in this sense the API is not business-centric, but the advantage is that you only need to learn one set of methods to access everything in the backend. As long as you know a given model exists, you can interact with it using the basic API, introspect it, follow relationships, etc. And that's what the UI does: to create an invoice it will call the create() method of the relevant model, passing the data that has been input by the user.

Accounting being implemented by OpenERP models like anything else, it is easily accessible using the API, for example:

  • You can access invoices and refunds using the API of the account.invoice model
  • You can access journal entries and journal items (the double-entry bookkeeping) using the API of the account.move and account.move.line models
  • You can access payment vouchers using the API of account.voucher, and bank statements via account.bank.statement), etc.

Now, in addition to the pure CRUD part, most business models will define extra bits of API:

  • Business workflows are defined on the main models (invoices, sales orders, etc.), and are driven by signals sent to the workflow when users click on certains types of buttons
  • Extra API and helper methods may be defined and called indirectly by CRUD methods or bound to certain buttons on the screens

Discovering and mastering those is required if you plan to do complex things on the backend without using the UI. But they're obviously specific to each model and not well documented. The best way to learn is to read the source code of the the relevant business models you're interested in. If you're not sure where to start, one helpful thing to do is to watch the API in action by looking at the RPC calls sent by the UI when you go through the relevant business flows. To do so you can either use the network debugger of your browser and watch the XHR calls, or start the OpenERP server with the --log-level=debug_rpc_answer option and read the extra log.

To answer the last part of your question, yes there are many users who are using the OpenERP API to manage their business data remotely from other applications (including invoices, accounting, and everything else). Unfortunately I do not have any code pointer to share, as most of them are doing that for specific use cases dealing with other proprietary products, or simply do not consider their use case generic enough to publish the source code. Perhaps other people could elaborate on this by providing links?

I hope that helps a bit...

2
Avatar
Descartar
Jason Judge
Autor

Thanks Olivier, that answers my questions very well :-)

Jason Judge
Autor

Hmm, I did just post a longer comment, but it seems to have got lost in transit. The short version was: steeper learning curve than I had hoped with lack of docs, but the code is well structured and easy to follow. I really think OpenERM needs to get that REST API out there, because other SAAS providers are drawing people in by the thousands by making interfacing through the APIs incredibly easy. If I end up going with OpenERM, I hope to GPL any PHP libraries I create (I do a lot of that).

Olivier Dony (odo)

I happen to have forked a very basic PHP lib (MIT license) from Valentin Lab that helps call the JSON_RPC API of OpenERP, if you want to use it as a starting point: https://github.com/odony/php-oe-json

Jason Judge
Autor

Thanks - I'll take a look at that.I personally lean towards composer libraries, so something like Guzzle would take care of the HTTP protocol. I also assume you would not need to log in on each page load or cron job, but could retain the session once logged in and keep using that until the application logs out or the session gets invalidated. I realise the code is alpha, so I'm taking your examples as proof of concept, which is a good start :-)

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Trying to Create Invoices via API Solved
accounting api API
Avatar
Avatar
Avatar
2
de set. 25
5609
How to generate accounting report via xmlrpc call odoo 17
accounting api Odoo17
Avatar
Avatar
1
de jul. 25
2657
How to set up Opening balance for Vendors/Customers?
accounting ledger openingbalances
Avatar
Avatar
1
de des. 17
8955
Is there a connector available for Odoo V8 to Exact Online Accounting?
accounting api odooV8
Avatar
Avatar
1
de des. 17
4534
Xero Odoo Api Integration Solved
apps api xero
Avatar
Avatar
1
de març 17
6264
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now