Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

API error on odoo 14

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
apipython3XML-RPCv14
2 Replies
3991 Rodiniai
Portretas
Juan

Hi everyone!
I developed the code below to read reports and data from odoo: 

import os

import xmlrpc.client

url = os.getenv('url')

db = os.getenv('db')

username = os.getenv('user')

password = os.getenv('password')

common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))

uid = common.authenticate(db, username, password,{})

models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))models.execute_kw(db, uid, password,'sale.order','check_access_rights',['read'],{'raise_exception':False})

Unfortunately, this code got this error 


Fault: Fault 1: 'Traceback (most recent call last):\n  File "/opt/odoo14/odoo/odoo/addons/base/controllers/rpc.py", line 88, in xmlrpc_2\n    response = self._xmlrpc(service)\n  File "/opt/odoo14/odoo/odoo/addons/base/controllers/rpc.py", line 68, in _xmlrpc\n    result = dispatch_rpc(service, method, params)\n  File "/opt/odoo14/odoo/odoo/http.py", line 142, in dispatch_rpc\n    result = dispatch(method, params)\n  File "/opt/odoo14/odoo/odoo/service/model.py", line 37, in dispatch\n    security.check(db,uid,passwd)\n  File "/opt/odoo14/odoo/odoo/service/security.py", line 9, in check\n    return res_users.check(db, uid, passwd)\nTypeError: \'Boolean\' object is not callable




I do a research, finding out that my UID may be a error code, however I tried with other password and I got different error. In other words, my credential are correct, but I can't use the API with my user. 

I would be grateful with any handy hand. 

Best, 
Juan Grimaldos

0
Portretas
Atmesti
Portretas
shubham shiroya
Best Answer

try this way:
import os

import xmlrpc.client


url = os.getenv('url')

db = os.getenv('db')

username = os.getenv('user')

password = os.getenv('password')


common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))

uid = common.authenticate(db, username, password, {})


models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))


# Search for sale orders

sale_orders = models.execute_kw(db, uid, password, 'sale.order', 'search', [[]])


# Read data for the first sale order

if sale_orders:

order_data = models.execute_kw(db, uid, password, 'sale.order', 'read', [sale_orders[0]])

print(order_data)

else:

print("No sale orders found.")


0
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,
1- Make certain that the Odoo API version being employed is the appropriate one, specifically XML-RPC version 2, which corresponds to Odoo 14.
2- Please verify that the URL is accurately directed to the correct Odoo server and that the database name is correct.
3- Ensure that the 'username' and 'password' variables contain the accurate login credentials for the specific Odoo user intended to access the API.
4- Ensure that the 'common.authenticate' function is functioning correctly and providing a valid 'uid,' which is essential for making subsequent API calls.
5- Verify whether all the essential Python dependencies and libraries required for making XML-RPC requests have been installed.
6- Check API Call: Review the 'models.execute_kw' call and ensure that all the parameters are correct. The format should be 'models.execute_kw(db, uid, password, model, method, args, kwargs)'.
7- Exception Handling, you can add exception handling to your code to catch any errors that may occur during the API calls.

eg:-

try:
    uid = common.authenticate(db, username, password, {})
except Exception as e:
    print("Authentication Error occurred:", e)


Hope it helps

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

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

Registracija
Related Posts Replies Rodiniai Veikla
ValueError: Compute method failed to assign Solved
python3 v14
Portretas
Portretas
Portretas
Portretas
Portretas
5
spal. 24
34121
what's the most recent Python version Odoo 14 can be built on ? Solved
python3 v14
Portretas
1
liep. 23
8787
XML-RPC API - error when adding lines to an existing order
api XML-RPC
Portretas
0
geg. 23
2971
Odoo External API limitations
api XML-RPC
Portretas
Portretas
1
kov. 24
7360
Odoo 14: API : Getting product quantity by location
api v14
Portretas
Portretas
1
saus. 23
2339
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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