Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

AttributeError: 'str' object has no attribute 'get' odoo14

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
pythonhelpdeskodoohelpforumv14
2 Réponses
8705 Vues
Avatar
alfik

Im getting this error while refreshing my custom made wizard model

The code

from odoo import fields, models, api

class CreateExam(models.TransientModel):
_name = 'exam.wizards'
_description = 'Create exams'

std_wiz = fields.Many2one(
comodel_name='std.record',
string='Student',
required=False)
std_subject = fields.Many2one('std.subject',string="Subject")
std_marks=fields.Float(string="Marks")

def save_btn(self):
print("saved")
return True



0
Avatar
Ignorer
alfik
Auteur

my xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="examwiz_view_form" model="ir.ui.view">
<field name="name">exam_view_form</field>
<field name="model">exam.wizards</field>
<field name="arch" type="xml">
<form string="exam form">
<sheet>
<group>
<field name="std_wiz"/>
<field name="std_subject"/>
<field name="std_marks"/>

</group>
</sheet>
<footer>
<button name="save_btn" string="save" type="object" class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="examwiz_action" model="ir.actions.act_window">
<field name="name"></field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">exam.wizards</field>
<field name="view_mode">form</field>
<field name="view_id" ref="examwiz_view_form"/>
<field name="target">new</field>
</record>
<!-- This Menu Item must have a parent and an action -->
<menuitem id="examwiz_categ" name="Create Exam" parent="school_root_menu" action="examwiz_action" sequence="5"/>

</data>
</odoo>

Avatar
Muhammad Ihza Putra Handayani
Meilleure réponse

this error is mostly caused by changing previous type field with perhaps is the same name, i suggest to uninstall the module that related to it or just make a new field with different name and different type

0
Avatar
Ignorer
Avatar
Waleed Mohsen (CorTex IT Solutions)
Meilleure réponse

You don't have any issue in your code as I can see. Check the log file to see more details about the error and which line cause this issue.

0
Avatar
Ignorer
alfik
Auteur

This is my log file. kindly check this out
ERROR: couldn't create the logfile directory. Logging to the standard output.
2022-02-20 16:22:48,158 5752 INFO ? odoo: Odoo version 14.0-20211201
2022-02-20 16:22:48,158 5752 INFO ? odoo: Using configuration file at C:\Users\alfik\PycharmProjects\pythonProject\odoo11\odoo.conf
2022-02-20 16:22:48,158 5752 INFO ? odoo: addons paths: ['C:\\Users\\alfik\\PycharmProjects\\pythonProject\\odoo11\\odoo\\addons', 'c:\\users\\alfik\\appdata\\local\\openerp s.a\\odoo\\addons\\14.0', 'c:\\users\\alfik\\pycharmprojects\\pythonproject\\odoo11\\odoo\\addons', 'c:\\users\\alfik\\pycharmprojects\\pythonproject\\custom_addons']
2022-02-20 16:22:48,158 5752 INFO ? odoo: database: admin@localhost:5432
2022-02-20 16:22:48,784 5752 INFO ? odoo.addons.base.models.ir_actions_report: Will use the Wkhtmltopdf binary at C:\Program Files\odoo14\thirdparty\wkhtmltopdf.exe
2022-02-20 16:22:49,104 5752 INFO ? odoo.service.server: HTTP service (werkzeug) running on DESKTOP-6UI91MB.bbrouter:8069
2022-02-20 16:22:49,163 5752 INFO alfikodoo odoo.modules.loading: loading 1 modules...
2022-02-20 16:22:49,179 5752 INFO alfikodoo odoo.modules.loading: 1 modules loaded in 0.02s, 0 queries (+0 extra)
2022-02-20 16:22:49,285 5752 INFO alfikodoo odoo.modules.loading: updating modules list
2022-02-20 16:22:49,304 5752 INFO alfikodoo odoo.addons.base.models.ir_module: ALLOW access to module.update_list on [] to user __system__ #1 via n/a
2022-02-20 16:22:50,790 5752 INFO alfikodoo odoo.addons.base.models.ir_module: ALLOW access to module.button_upgrade on ['student'] to user __system__ #1 via n/a
2022-02-20 16:22:50,790 5752 INFO alfikodoo odoo.addons.base.models.ir_module: ALLOW access to module.update_list on ['student'] to user __system__ #1 via n/a
2022-02-20 16:22:51,894 5752 INFO alfikodoo odoo.addons.base.models.ir_module: ALLOW access to module.button_install on [] to user __system__ #1 via n/a
2022-02-20 16:22:52,002 5752 INFO alfikodoo odoo.modules.loading: loading 79 modules...
2022-02-20 16:22:52,049 5752 WARNING alfikodoo odoo.addons.attachment_indexation.models.ir_attachment: Attachment indexation of PDF documents is unavailable because the 'pdfminer' Python library cannot be found on the system. You may install it from https://pypi.org/project/pdfminer.six/ (e.g. `pip3 install pdfminer.six`)
2022-02-20 16:22:52,782 5752 INFO alfikodoo odoo.modules.loading: Loading module student (42/79)
2022-02-20 16:22:53,164 5752 INFO alfikodoo odoo.modules.registry: module student: creating or updating database tables
2022-02-20 16:22:53,482 5752 INFO alfikodoo odoo.modules.loading: loading student/views/studentrecord.xml
2022-02-20 16:22:53,607 5752 INFO alfikodoo odoo.modules.loading: loading student/security/ir.model.access.csv
2022-02-20 16:22:53,663 5752 INFO alfikodoo odoo.modules.loading: loading student/views/studentclass.xml
2022-02-20 16:22:53,704 5752 INFO alfikodoo odoo.modules.loading: loading student/security/security.xml
2022-02-20 16:22:53,724 5752 INFO alfikodoo odoo.modules.loading: loading student/views/teacher.xml
2022-02-20 16:22:53,775 5752 INFO alfikodoo odoo.modules.loading: loading student/views/teacherdetails.xml
2022-02-20 16:22:53,789 5752 INFO alfikodoo odoo.modules.loading: loading student/wizard/exam_wizard.xml
2022-02-20 16:22:53,835 5752 INFO alfikodoo odoo.modules.loading: Module student loaded in 1.05s, 424 queries
2022-02-20 16:22:54,764 5752 INFO alfikodoo odoo.modules.loading: 79 modules loaded in 2.76s, 424 queries (+0 extra)
2022-02-20 16:22:55,518 5752 INFO alfikodoo odoo.addons.base.models.ir_model: Deleting 1427@ir.model.fields.selection (student.selection__exam_wizards__std_subject__english)
2022-02-20 16:22:55,521 5752 WARNING alfikodoo odoo.modules.loading: Transient module states were reset
2022-02-20 16:22:55,533 5752 ERROR alfikodoo odoo.modules.registry: Failed to load registry
2022-02-20 16:22:55,533 5752 CRITICAL alfikodoo odoo.service.server: Failed to initialize database `alfikodoo`.
Traceback (most recent call last):
File "C:\Users\alfik\PycharmProjects\pythonProject\odoo11\odoo\service\server.py", line 1199, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "C:\Users\alfik\PycharmProjects\pythonProject\odoo11\odoo\modules\registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "C:\Users\alfik\PycharmProjects\pythonProject\odoo11\odoo\modules\loading.py", line 503, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "C:\Users\alfik\PycharmProjects\pythonProject\odoo11\odoo\addons\base\models\ir_model.py", line 2296, in _process_end
record.unlink()
File "C:\Users\alfik\PycharmProjects\pythonProject\odoo11\odoo\addons\base\models\ir_model.py", line 1370, in unlink
self._process_ondelete()
File "C:\Users\alfik\PycharmProjects\pythonProject\odoo11\odoo\addons\base\models\ir_model.py", line 1418, in _process_ondelete
ondelete = (field.ondelete or {}).get(selection.value)
AttributeError: 'str' object has no attribute 'get'

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Element cannot be located in parent view. odoo 14
error helpdesk odoo helpforum v14
Avatar
Avatar
Avatar
2
mai 23
7956
index error: list index out of range
csv helpdesk odoo helpforum v14
Avatar
0
mars 22
101
How to raise a warning like "Your DOB is should be less then today date"? Résolu
helpdesk date.time odoo helpforum v14
Avatar
Avatar
Avatar
2
févr. 22
4260
psycopg2.ProgrammingError: can't adapt type 'NewId' in odoo 14
python odoo NewId v14
Avatar
Avatar
1
juin 23
6289
Odoo 14 - Send Email Contact Form URL Résolu
python python3 odoo v14
Avatar
1
mars 23
3304
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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