Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Odoo 8 API Problem. Not JSON Serializable

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
developmentapijsonserializationodoo8
1 Răspunde
10221 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Zbik
Cel mai bun răspuns

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
Imagine profil
Abandonează
Patrick Hofacker
Autor

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
Autor

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!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
How to make pagination in JSON-RPC api call ?
api json
Imagine profil
Imagine profil
2
iul. 23
7658
Write records from another model
api odoo8
Imagine profil
Imagine profil
1
aug. 20
5220
Can someone explain me the xpath? Rezolvat
development module odoo8
Imagine profil
Imagine profil
2
oct. 15
7477
json api
api json java
Imagine profil
0
mar. 15
6684
Odoo 8+: how to restart server when python has been changed?
development restart odoo8
Imagine profil
Imagine profil
Imagine profil
2
mar. 15
18139
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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