Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

External API Error - Getting sale.order information

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
apiapiclient
3 Replies
5486 Tampilan
Avatar
xenic82661

Hi
I'm testing odoo external APi and I'm getting this error when i execute this last command:
models.execute_kw(db, uid, password, 'sale.order', 'search', [[]])
[4, 3, 1]

models.execute_kw(db, uid, password, 'sale.order', 'read', [1])

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\xenic82661\AppData\Local\Programs\Python\Python39\lib\xmlrpc\client.py", line 1116, in __call__
return self.__send(self.__name, args)
File "C:\Users\xenic82661\AppData\Local\Programs\Python\Python39\lib\xmlrpc\client.py", line 1458, in __request
response = self.__transport.request(
File "C:\Users\xenic82661\AppData\Local\Programs\Python\Python39\lib\xmlrpc\client.py", line 1160, in request
return self.single_request(host, handler, request_body, verbose)
File "C:\Users\xenic82661\AppData\Local\Programs\Python\Python39\lib\xmlrpc\client.py", line 1176, in single_request
return self.parse_response(resp)
File "C:\Users\xenic82661\AppData\Local\Programs\Python\Python39\lib\xmlrpc\client.py", line 1348, in parse_response
return u.close()
File "C:\Users\xenic82661\AppData\Local\Programs\Python\Python39\lib\xmlrpc\client.py", line 662, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: \n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/home/odoo/src/odoo/saas-16.1/odoo/addons/base/controllers/rpc.py", line 148, in xmlrpc_2\n response = self._xmlrpc(service)\n File "/home/odoo/src/custom/trial/saas_trial/controllers/main.py", line 266, in _xmlrpc\n res = super(OdooRPC, self)._xmlrpc(service)\n File "/home/odoo/src/odoo/saas-16.1/odoo/addons/base/controllers/rpc.py", line 129, in _xmlrpc\n return xmlrpc.client.dumps((result,), methodresponse=1, allow_none=False)\n File "/usr/lib/python3.10/xmlrpc/client.py", line 981, in dumps\n data = m.dumps(params)\n File "/usr/lib/python3.10/xmlrpc/client.py", line 514, in dumps\n dump(v, write)\n File "/usr/lib/python3.10/xmlrpc/client.py", line 536, in __dump\n f(self, value, write)\n File "/usr/lib/python3.10/xmlrpc/client.py", line 589, in dump_array\n dump(v, write)\n File "/usr/lib/python3.10/xmlrpc/client.py", line 536, in __dump\n f(self, value, write)\n File "/usr/lib/python3.10/xmlrpc/client.py", line 607, in dump_struct\n dump(v, write)\n File "/usr/lib/python3.10/xmlrpc/client.py", line 536, in __dump\n f(self, value, write)\n File "/usr/lib/python3.10/xmlrpc/client.py", line 607, in dump_struct\n dump(v, write)\n File "/usr/lib/python3.10/xmlrpc/client.py", line 526, in __dump\n raise TypeError("cannot marshal %s objects" % type(value))\nTypeError: cannot marshal objects\n'>

 
BTW for res.partner is working without any problem
models.execute_kw(db, uid, password, 'res.partner', 'search', [[]])
[9, 10, 8, 7, 1, 3]

models.execute_kw(db, uid, password, 'res.partner', 'read', [9])

[{'id': 9, 'message_is_follower': True, 'message_follower_ids': [...], 'message_partner_ids': [...], 'message_ids': [...], 'has_message': True, 'message_needaction': False, 'message_needaction_counter': 0, 'message_has_error': False, ...}]

0
Avatar
Buang
Niyas Raphy (Walnut Software Solutions)

seems the shared one line of code is fine for me, to debug more to cross check again, may be this helps: https://www.odoo.com/documentation/16.0/developer/api/external_api.html

Avatar
Mikhail Zuev
Jawaban Terbai

We are experiencing the same error. Could you please tell me if you solved it?

0
Avatar
Buang
Mikhail Zuev

odoo support suggested specifying the exact orders attributes/fields that you want to download
this solved our issue

import xmlrpc.client

url = '<insert_own_db_url>'
db = '<insert_db_name>'

## username and password for uid performing search read
username=''
password=''

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

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

models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))
models.execute_kw(db, uid, password,
'sale.order', 'search_read',
[[['id', '<', 10]]], # Replace with your own search domain
{'fields': ['id', 'name']}) # replace with necessary fields that you would like to read

Avatar
xenic82661
Penulis Jawaban Terbai

Thanks for your reply Bennie, I already executed the 'search' and this record exists

0
Avatar
Buang
Avatar
Bennie
Jawaban Terbai

You must be used to "search" method before "read" method.
You can used to "read" method when you know exactly recordset of model. Let's reference document for detail.

ids = models.execute_kw(db, uid, password, 'res.partner', 'search', [[['is_company', '=', True]]], {'limit': 1})
[record] = models.execute_kw(db, uid, password, 'res.partner', 'read', [ids])


0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
How can we accept a clients orders using the Odoo API
api apiclient
Avatar
0
Jul 21
2516
How to send data from odoo to another oracle database using AP I? mettre a jours ou creer ou suprimer les donnes d une application oracle externes a partir de odoo
api send apiclient
Avatar
Avatar
1
Jan 23
3440
External API Auth problem
api apiclient v15
Avatar
0
Des 21
3852
How add new Log Note to Lead/Opportunity using API Diselesaikan
api apiclient odoov12
Avatar
Avatar
1
Jun 20
8994
how can using odoo api without session id i want using jwt authentication ?
api apiclient ReactJs
Avatar
0
Nov 19
7209
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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