İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Odoo 8 API Problem. Not JSON Serializable

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
developmentapijsonserializationodoo8
1 Cevapla
10222 Görünümler
Avatar
Patrick Hofacker

Hey guys,

i'm trying to solve call a wizard(lets call it wiz2) out of another wizard(call this wiz1), then comfortably change the records of the wiz1-model via the model of wiz2.

My problem ist now that i get errors.. over and over, may one of you is able to help me.

here is my code so far:

The Code of the wiz1:


# -*- coding: utf-8 -*-
from openerp import models, fields, api
from openerp import exceptions
class TransferExtension(models.TransientModel):
_inherit = 'stock.transfer_details_items'
@api.multi
def do_enter_serials(self):
self.ensure_one()
#get the reference on new model
wizardmodel = self.env['serial.wizard']
#create new record
res_id = wizardmodel.create({'item_clicked':self.id})
#Read the view_id.
view = self.env.ref('unique_serials_v1.view_serial_wizard')
#call the other wizard
return {
'name': 'Eingabe der Serialnummern',
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'serial.wizard',
'res_id': res_id,
'views': [(view.id, 'form')],
'view_id': view.id,
'target': 'new'
}

And this is the code of my wiz2

# -*- coding: utf-8 -*-
from openerp import models, fields, api
from openerp import exceptions
class SerialWizard(models.TransientModel):
_name = 'serial.wizard'
item_clicked = fields.Many2one('stock.transfer_details_items',string='Item') 

so i'm getting the error:

Odoo Server Error

Traceback (most recent call last):

File "/opt/odoo/openerp/http.py", line 537, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/opt/odoo/openerp/http.py", line 588, in dispatch

return self._json_response(result)

File "/opt/odoo/openerp/http.py", line 526, in _json_response

body = simplejson.dumps(response)

File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 354, in dumps

return _default_encoder.encode(obj)

File "/usr/lib/python2.7/dist-packages/simplejson/encoder.py", line 262, in encode

chunks = self.iterencode(o, _one_shot=True)

File "/usr/lib/python2.7/dist-packages/simplejson/encoder.py", line 340, in iterencode

return _iterencode(o, 0)

File "/usr/lib/python2.7/dist-packages/simplejson/encoder.py", line 239, in default

raise TypeError(repr(o) + " is not JSON serializable")

TypeError: serial.wizard(7,) is not JSON serializable

 

and don't have any idea where the problem is.

Hope you can help me

Thanks in Advance

Patrick

0
Avatar
Vazgeç
Avatar
Zbik
En İyi Yanıt

Documentation new api - method create():

Takes a number of field values, and returns a recordset containing the record created:

>>> self.create({'name': "New Name"})

res.partner(78)


Conclusion: your problem with res_id

1
Avatar
Vazgeç
Patrick Hofacker
Üretici

Oh my god... im such an idiot... Many Thanks... take all my upvotes i can give to you. That was the solution

Zbik

If the answer is correct, select rather that you accept it. Additionally, you can possibly vote.

Patrick Hofacker
Üretici

Sry didn't find the button right away. But now your answer is marked. Thank your very much... im hanging there since 2 weeks

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

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
How to make pagination in JSON-RPC api call ?
api json
Avatar
Avatar
2
Tem 23
7659
Write records from another model
api odoo8
Avatar
Avatar
1
Ağu 20
5221
Can someone explain me the xpath? Çözüldü
development module odoo8
Avatar
Avatar
2
Eki 15
7477
json api
api json java
Avatar
0
Mar 15
6685
Odoo 8+: how to restart server when python has been changed?
development restart odoo8
Avatar
Avatar
Avatar
2
Mar 15
18139
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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