Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2517 Näkymät

I'm trying to use the Odoo API (XMLRPC) with Python to create on the fly invoices. However I face some problem because I found some inconsistencies between what I can see on my odoo platform (Saas solution) and what I get from the API. For example, I create manually a new invoice on the platform and when I list the invoices from the API I can't see it.

host="https://db.odoo.com"
db = "db"
username = 'mail@mail.com'
password="mdp"
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(host))
uid = common.authenticate(db, username, password, {})
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(host))
invoices = models.execute_kw(db, uid, password,'account.invoice','search_read',[[]])
invoices

So on my web platform I have 5 invoices, but I can only read 2 of them from the API. 

Thanks a lot for your help ! 


            
            
Avatar
Hylkää

Please post your script so that we can help you.

Tekijä

I just updated my post ! Thanks !

Hi,

For invoice creation, you can check out Salesforce Odoo Connector: https://eshopsync.com/odoo/

Hope this helps!

Thanks!

Do you see all the invoices in Odoo with the user you are using in the script? If you are using a different user then there is a possibility of the security rules are causing the issue.