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

ProgrammingError: can't adapt type 'dict' [SOLVED]

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
openerp
2 Replies
58755 Rodiniai
Portretas
dirtyHandsPHP

In OpenERP while saving data I got this error : ProgrammingError: can't adapt type 'dict' 

I am having two tables : 

class hr_employee(osv.osv):
    _inherit = 'hr.employee'
    _name = 'hr.employee'
    _columns = {
                'emp_code':fields.char('Employee Code', size=6, readonly=True),
                'religion_id':fields.many2one('hr.religion', 'Religion'),
                'pan_id':fields.char('PAN Number', size=10),
                'marriage_date':fields.date('Marriage Date'),
                'lang_speak_ids':fields.many2many('hr.language','rel_empspeak_lang', 'employee_id','language_id', 'Languages Speak'),
                'lang_write_ids':fields.many2many('hr.language','rel_empwrite_lang', 'employee_id','language_id', 'Languages Write'),
                'education_ids':fields.one2many('hr.education.detail','employee_id', 'Courses'),
                'family_detail_ids':fields.one2many('hr.family.detail','employee_id', 'Family Details'),
                'employement_detail_ids':fields.one2many('hr.employment.detail','employee_id', 'Work Experience Information'),
                'reference_detail_ids':fields.one2many('hr.reference.detail','employee_id', 'Reference Details'),
                'training_detail_ids':fields.one2many('hr.training.detail','employee_id', 'Training Details'),
                'medical_detail_ids':fields.many2one('hr.medical.detail', 'Medical Details')                                
               }

and

 

class hr_medical_detail(osv.osv):
    
    _name = 'hr.medical.detail'
    _rec_name = 'blood_group'    
    _columns = {
                'blood_group':fields.char('Please mention your blood group:', size=100, required=True),
                'medicine':fields.boolean('Are you taking any medicine?'),               
                'physician_address':fields.text('Please mention your physician name & address:')   
                                
               }

While saving medical details getting this error.

Please, can anyone tell what could be the reason?

0
Portretas
Atmesti
Emipro Technologies Pvt. Ltd.

I am not sure, just a thought, can it be due to the ":" in the string for "blood_group" column.

ABU K

please add your xml file here ,then i can check...

dirtyHandsPHP
Autorius

Thanks for your quick response guys!!! Problem was with my __openerp__.py

ABU K

check your __openerp__.py file syntax

Portretas
Andre Leander
Best Answer

Hello Shiv.. I got same problem. How did u fix this?

0
Portretas
Atmesti
Portretas
O Sluys
Best Answer

I was getting the same error but in my situation the problem happened to be that I had mistakenly used a many2one field in place of a one2many field. Looking at your code, I also see that you may have done the same thing:

'medical_detail_ids': fields.many2one('hr.medical.detail', 'Medical Details')

It appears that you meant to use a one2many field here, so it should look like this:

'medical_detail_ids': fields.one2many('hr.medical.detail', 'employee_id', 'Medical Details')

You would also need to add the following reciprocal field to hr_medical_detail:

'employee_id': fields.many2one('hr.employee', 'Employee')


The error only appeared for me when I specified a one2many widget for the field in the form view and tried to add a line item and save the form, so I suspect that you were also using a one2many widget in your form view to represent the medical_detail_ids field. Naturally, the one2many widget is not the appropriate widget to use for a many2one, and thus the cryptic error.

You say that you fixed your problem by correcting the __openerp__.py file but perhaps that was just coincidence. If you could post exactly what was wrong with your file and how you fixed it, we could determine if that was the case, and it would also help out anyone else who may have the same problem.



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
Create selection type field dynamically?
openerp
Portretas
Portretas
Portretas
2
rugs. 23
8430
How to hide the create button dynamical tree view in openerp ? Solved
openerp
Portretas
Portretas
2
kov. 23
47636
How to use the audit app
openerp
Portretas
0
kov. 22
2973
How to change default action of elements of tree view?
openerp
Portretas
Portretas
3
birž. 20
11329
Problem with ECommerce module 404 error while confirming invoice????????
openerp
Portretas
Portretas
1
spal. 19
5067
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